cli-and-io
Use TorchIO's command-line interface and I/O integration surfaces for image metadata, conversion, transform commands, cache inspection, visualization exports, and local or remote NIfTI/NIfTI-Zarr backends.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- cli-and-io
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Use TorchIO's command-line interface and I/O integration surfaces for image metadata, conversion, transform commands, cache inspection, visualization exports, and local or remote NIfTI/NIfTI-Zarr backends.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/cli-reference.md4.9 KB
- 参考文档references/io-backends.md5.8 KB
- 参考文档references/troubleshooting.md5.3 KB
- 脚本scripts/torchio_cli_smoke.py5.7 KB
03 SKILL.md 正文
TorchIO CLI and I/O
Use this sub-skill when the task is to run or generate torchio CLI commands, inspect or convert medical image files, apply a one-off transform from the shell, manage TorchIO's dataset cache, troubleshoot plotting or animation exports, or reason about local, remote, and NIfTI-Zarr image loading.
Route Map
- For CLI syntax, safe command patterns, command-specific caveats, and the bundled smoke check, read CLI reference.
- For accepted image sources, lazy backends, remote URI behavior, NIfTI-Zarr conversion, and optional cloud extras, read I/O backends.
- For failures involving missing extras, Tyro argument parsing, cache side effects, remote credentials,
.nii.zarrdependencies, or non-notebook plotting, read troubleshooting. - To verify a TorchIO CLI installation on synthetic data, run
python sub-skills/cli-and-io/scripts/torchio_cli_smoke.py --helpfirst, then run the script without arguments.
Quick Start
- Confirm the CLI is installed:
torchio --versionorpython -m torchio.cli --version. - Inspect an image:
torchio info image.nii.gz. - Convert between supported image formats:
torchio convert input.nii.gz output.niiortorchio convert input.nii.gz output.nii.zarrwhen thezarrextra is installed. - Apply a one-off transform:
torchio transform input.nii.gz output.nii.gz Noise std=0.1ortorchio transform input.nii.gz crop.nii.gz CropOrPad target_shape=128. - Save visual output explicitly outside notebooks:
torchio plot image.nii.gz --output slices.pngortorchio animate image.nii.gz sweep.gif --seconds 3 --direction I.
Boundaries
- This sub-skill owns CLI command generation, image file I/O behavior, optional visualization/export dependencies, remote/Zarr/cloud caveats, and cache command safety.
- For in-Python image construction such as
tio.ScalarImage(tensor)or subject metadata modeling, route to the data-model sub-skill. - For composing transform pipelines in Python, current transform class names, and transform API details, route to the transforms sub-skill.
- For patch sampling, training queues, aggregation, and inference tiling, route to the patch-workflows sub-skill.
Safety Defaults
- Prefer
torchio cache dirovertorchio cache clean; cleaning without a dataset name removes all TorchIO cached data. - Treat cloud URIs as network and credential-dependent; avoid running them in smoke checks unless the user explicitly provides a safe test endpoint and credentials.
- Use
--outputforplotand explicit.gifor.mp4paths foranimatein non-interactive sessions.
04 同仓库更多 Skills
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.
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.
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.
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.
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.
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).