totalsegmentator
Use TotalSegmentator as an installed package for medical-image segmentation, task discovery, runtime configuration, output parsing, DICOM handling, auxiliary analysis, and advanced training boundaries.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- totalsegmentator
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Use TotalSegmentator as an installed package for medical-image segmentation, task discovery, runtime configuration, output parsing, DICOM handling, auxiliary analysis, and advanced training boundaries.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/repo-provenance.md3.9 KB
- 参考文档references/repo-routing-metadata.json335 B
- 参考文档references/task-selection.md3.0 KB
- 参考文档references/troubleshooting.md3.9 KB
- 脚本scripts/check_install.py4.0 KB
03 SKILL.md 正文
TotalSegmentator
Use this skill when a user asks about TotalSegmentator, the TotalSegmentator CLI, the totalsegmentator Python package, anatomical CT/MR segmentation tasks, model-weight or license setup, segmentation output parsing, DICOM/NIfTI handling, or TotalSegmentator-style nnU-Net retraining.
TotalSegmentator outputs are research/workflow artifacts unless the surrounding product has its own approved clinical validation. Preserve input provenance, verify task/class choices, and prefer machine-readable JSON outputs over scraping stdout.
Quick Start
- Discover capabilities first when task or class names are uncertain:
totalseg_info --jsonor capability-discovery. - Build segmentation commands through segmentation-workflows; add
--report <path.json>for automation. - Parse
run_report.json,statistics.json, multilabel outputs, probabilities, and combined masks through outputs-and-statistics. - Use runtime-configuration for install/import checks, CPU/GPU/MPS decisions, model weights, offline setup, licenses, and usage-stat settings.
- Use dicom-and-formats before long runs when inputs are DICOM folders/zips, DICOM output is requested, or crop-to-body preprocessing is needed.
Route by User Intent
| User intent | Read this |
|---|---|
List tasks, classes, modalities, license flags, or valid --roi_subset names |
capability-discovery |
| Build or run a CT/MR segmentation CLI/API workflow | segmentation-workflows |
| Validate reports, statistics, masks, multilabel headers, probabilities, or combined masks | outputs-and-statistics |
| Fix install/import/backend issues, choose devices, pre-stage weights, configure offline or licensed tasks | runtime-configuration |
| Validate NIfTI/DICOM inputs, DICOM SEG/RTSTRUCT outputs, modality detection, or crop-to-body preprocessing | dicom-and-formats |
| Use contrast phase, CT/MR modality, body stats, or Evans index helper CLIs | auxiliary-analysis |
| Plan retraining, dataset conversion, benchmark evaluation, or model-contribution work | advanced-training |
Safe Install and Smoke Check
Install the public package in the user's chosen environment:
pip install TotalSegmentator
Then run safe checks that do not download model weights:
totalseg_info --json
python scripts/check_install.py --task total --class-name liver --json
The root helper verifies package metadata, importability, registry access, selected task/class names, and console-script availability. It does not run segmentation, validate licenses against the network, or download weights.
Common Workflows
- Automation pipeline: discover task/classes with
totalseg_info --json, build aTotalSegmentatorcommand with--reportand optional--statistics, then parse JSON files through the outputs sub-skill. - CPU-only run: choose
--device cpu, add--fastor a small--roi_subset, and use the segmentation troubleshooting reference for memory/runtime limits. - Offline deployment: use runtime configuration to set a writable TotalSegmentator home, pre-stage weights, save any required license, and run read-only diagnostics before inference.
- DICOM output: validate the input as DICOM first, install the needed optional DICOM output dependency, and avoid requesting DICOM output from NIfTI input.
- Advanced research: use the training sub-skill only for explicit retraining/evaluation/contribution requests; ordinary segmentation should stay in the segmentation workflow.
Runtime References
- Read references/task-selection.md for task, class, modality, and license selection patterns.
- Read references/troubleshooting.md for cross-cutting install, data, CLI/API, optional dependency, model-weight, and license failures.
- Read references/repo-provenance.md to decide whether this skill is aligned with the source version.
references/repo-routing-metadata.jsoncontains structured metadata for managed router import.
Boundaries
- Do not hard-code task/class lists from memory; use
totalseg_infoortotalsegmentator.registry. - Do not run heavyweight segmentation, model downloads, licensed tasks, or training by default when the user only needs planning or validation.
- Do not expose license numbers, local cache paths, or environment paths in shared reports.
- Do not treat skipped native examples or heavyweight tests as passing; record why they are skipped and use safe JSON/helper checks where possible.
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).