skillfed

TotalSegmentator

Robust segmentation of 117 classes in CT images.

totalsegmentator v2.18.0 87.3K downloads/30d#13,805 on PyPI2,932
Permissive license Apache 2.0 Active released

What it is and what it does

TotalSegmentator is a command-line and Python API tool that automatically identifies and labels anatomical structures in medical CT and MR images using neural networks trained on diverse scanner protocols and institutions. It outputs segmentation masks for 117 anatomical classes in CT scans or 50 in MR scans, plus specialized subtasks for organs, vessels, vertebrae, and pathologies. The package wraps nnUNetv2 and depends on PyTorch, SimpleITK, nibabel, and scikit-image for image I/O, processing, and visualization.

It is designed for research and clinical decision support (though not FDA-cleared as a standalone device). The tool runs on CPU or GPU across Ubuntu, Mac, and Windows. Input accepts Nifti files or DICOM folders; output is segmentation masks in standard medical image formats. The package is actively maintained, has no known vulnerabilities, and is permissively licensed.

Use it for:

  • Automated organ volume measurement for abdominal imaging reports and follow-up studies
  • Rapid vertebrae identification and labeling in spine imaging for surgical planning
  • Vessel segmentation (aorta, pulmonary artery) for diameter measurement and aneurysm screening
  • Research preprocessing: batch segmentation of large CT/MR cohorts for statistical analysis
  • Integration into clinical workflows via 3D Slicer extension or web API for real-time reporting
  • Body composition analysis: extracting muscle, fat, and bone measurements from imaging

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Automated segmentation of anatomical structures in CT and MR medical images, identifying and labeling 117 classes in CT or 50 classes in MR scans using deep learning.

Yes, with conditions. Install if you need automated medical image segmentation for research or clinical support and have PyTorch and GPU resources available. The active maintenance, permissive license, zero known vulnerabilities, and broad anatomical coverage make it a solid choice. Avoid if you require FDA-cleared medical device certification or cannot accommodate the large dependency footprint and model download. CPU-only use is feasible but slow without the --fast flag.

Install

totalsegmentator on PyPI

pip

pip install totalsegmentator

uv

uv add totalsegmentator

poetry

poetry add totalsegmentator

Installing TotalSegmentator

Before you install

Low friction install with a pure Python wheel. Active maintenance—last commit 2026-08-13, released 2026-08-12. Requires PyTorch >= 2.0.0 and Python >= 3.9; the large dependency tree (23 runtime packages including torch, nnunetv2, SimpleITK) means first install may take time, but no compiled barriers.

License in practice

Apache 2.0 permissive license allows commercial and private use, modification, and redistribution with minimal restrictions. Suitable for both research and production deployment.

Quickstart

pip install TotalSegmentator

from totalsegmentator.python_api import totalsegmentator_python_api

totalsegmentator_python_api(
    input_path='ct.nii.gz',
    output_path='segmentations',
    task='total'
)

Requires PyTorch >= 2.0.0 and Python >= 3.9. First run downloads trained model weights. GPU strongly recommended; CPU mode requires --fast or --roi_subset flags for reasonable runtime.

Verify before relying

  • Exact model weight download size and storage footprint after installation
  • Whether the package includes pre-trained weights or downloads them on first use
  • Performance benchmarks (runtime, memory) on typical CPU vs GPU hardware
  • Validation accuracy metrics on external test datasets beyond the cited papers

Package facts

License Apache 2.0 (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 23 — torch, numpy, SimpleITK, nibabel, tqdm, xvfbwrapper, nnunetv2, requests, dicom2nifti, pyarrow, xmltodict, blosc, imgkit, jinja2, Pillow, scikit-image, scipy, matplotlib, networkx, pandas, scikit-learn, fury, dipy
Maintenance actively maintained — 2 days since the last release
Last repo commit
First released
Downloads 87,292/month — #13,805 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: totalsegmentator-2.18.0-py3-none-any.whl

Intended Audience :: Science/ResearchOperating System :: MacOSOperating System :: UnixProgramming Language :: PythonTopic :: Scientific/Engineering

Tags

medical image segmentationCT MR anatomical segmentationorgan segmentation tooldeep learning medical imagingautomated anatomy detectionDICOM segmentationneural network medical imaging
medical-imagingdeep-learningsegmentation

More Scientific/Engineering packages