AGENT SKILL

antspy

Use ANTsPy/antspyx for medical image IO, ANTsImage metadata, image operations, registration, segmentation, visualization, and learning helper workflows.

License 许可
Apache-2.0
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
antspy
license
Apache 2.0
metadata
{ "disco-role": "operating" }
description
Use ANTsPy/antspyx for medical image IO, ANTsImage metadata, image operations, registration, segmentation, visualization, and learning helper workflows.
disable-model-invocation
true

02 资源文件 7

03 SKILL.md 正文

ANTsPy Repo Skill

Use this repo skill when a task involves the Python package distributed as antspyx and imported as ants: medical image IO, ANTsImage objects, preprocessing, registration, transforms, segmentation, labels, plotting, interoperability, or ANTsPy learning/deeplearn helper utilities.

Start Here

  1. Install the package with pip install antspyx or conda install conda-forge::antspyx.
  2. Verify the public import with python -c "import ants; print(ants.__name__)".
  3. Run scripts/antspy_environment_check.py for a tiny import/API smoke check.
  4. Read references/package-overview.md for package scope, compiled-backend caveats, and workflow boundaries.
  5. Read references/troubleshooting.md when installation, import, compiled libraries, physical-space metadata, optional dependencies, or expensive algorithms fail.
  6. Check references/repo-provenance.md before deciding whether this skill is stale for a newer ANTsPy checkout.

Route by Task

User task Read
Create, read, write, clone, index, compare, or validate ants.ANTsImage objects and physical metadata image-core
Smooth, denoise, mask, crop, pad, slice, resample, threshold, run iMath, compute image metrics, or use morphology image-ops-math
Register images, apply transforms to images or points, inspect transform files, build templates, run motion correction, or compute Jacobians registration-transforms
Run Atropos, k-means, Otsu, priors, joint label fusion, label stats, overlap, geometry, label matrices, centroids, or point images segmentation-labels
Save plots headlessly, build overlays/grids/movies, handle RGB/vector channels, convert image lists/matrices, or interoperate with nibabel/SimpleITK visualization-interop
Use sparse/eigen learning helpers, patch extraction/reconstruction, one-hot labels, random augmentation, simulated bias fields, or learning-oriented crop/pad helpers learning-deeplearn

Cross-Cutting Rules

  • Import with import ants; do not import antspyx as a module.
  • ANTsPy wraps compiled ANTs/ITK code. A successful pip install is not enough if importing ants fails; run the environment check script before debugging workflow code.
  • ANTsImage values and physical metadata are both important. Validate shape, dimension, origin, spacing, and direction before mixing images, masks, labels, transforms, overlays, or matrices.
  • Use label-safe interpolation such as nearestNeighbor or genericLabel for labels and masks. Use linear-style interpolation for intensity images unless the workflow requires otherwise.
  • Prefer small synthetic images for smoke checks and troubleshooting. Full nonlinear registration, joint label fusion, high-resolution 3-D operations, and template building can be expensive.
  • Keep ANTsPyNet, neural-network model training, and application-specific medical pipelines outside this skill unless the task only uses ANTsPy helper utilities.

Shared References and Scripts

  • Package overview: package identity, public workflow map, data model, optional dependencies, and version caveats.
  • API index: quick map from common ants.* functions to the owning sub-skill and detailed reference.
  • Troubleshooting: install/import failures, wheel/source-build problems, shadowed imports, physical-space errors, optional dependencies, and expensive workflow triage.
  • Repo provenance: source commit, dirty-state baseline, package versions, and evidence paths used for this generated skill.
  • Routing metadata: structured scenario metadata consumed by the managed repo-skills-router during import.
  • Environment check: tiny import/API smoke check for antspyx.
  • Smoke suite: runs the bundled sub-skill smoke scripts with the current Python interpreter.

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-triton-opt

Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-solve

END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-skill

PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-pattern-fusion

Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-orchestrate

Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-feedback

Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).

★ 351