Overview
TotalSegmentator is a tool for segmentation of most major anatomical structures in any CT or MR image. It takes a scan as input and outputs a labelled mask for each structure it finds, without any manual outlining.
The default CT task covers 117 main classes, and a separate MR task covers 50 classes, so a single run can label organs, bones, vessels, and muscles across the body. It reads NIfTI files or DICOM folders and can write NIfTI, DICOM segmentation, or DICOM RT structure output.
The project is open source and is described in an associated Radiology AI paper. The authors state it is not a medical device and is not intended for clinical usage, so it is meant for research rather than direct patient care.
What it does
- Segments over 100 anatomical structures, with 117 classes in the default CT task and 50 in the MR task
- Works on both CT and MR images, selecting the modality through the task option
- Runs from a single command line call or from a Python API
- Accepts NIfTI files or DICOM folders and zips as input
- Writes NIfTI by default, plus DICOM segmentation and DICOM RT structure output
- Offers a --fast lower resolution mode and a --statistics option that reports volume and mean intensity per class
Getting started
Install the package with pip, then run segmentation on a scan from the command line or from Python.
Install TotalSegmentator
Install the package from PyPI with pip.
pip install TotalSegmentatorSegment a CT image
Point the CLI at a CT NIfTI file and choose an output folder for the masks.
TotalSegmentator -i ct.nii.gz -o segmentationsSegment an MR image
Use the total_mr task to segment an MR image instead of CT.
TotalSegmentator -i mri.nii.gz -o segmentations --task total_mrRun from Python
Call the same segmentation from Python through the python_api module.
from totalsegmentator.python_api import totalsegmentator
totalsegmentator(input_path, output_path)Commands and code are distilled from the project's own documentation — always check the official repo for the latest.
When to use it
- Automatically label organs and other structures across a batch of research CT or MR scans
- Measure the volume and mean intensity of each structure using the --statistics output
- Restrict a run to a few structures with --roi_subset to save runtime and memory
- Export masks as DICOM segmentation or RT structure for use in downstream research pipelines
How TotalSegmentator compares
TotalSegmentator alongside other open-source medical imaging tools AI/TLDR tracks, ranked by GitHub stars.
| Tool | Stars | What it does |
|---|---|---|
| nnU-Net | ★ 8.7k | Self-configuring deep-learning framework that automatically adapts U-Net pipelines to any biomedical image segmentation dataset. |
| MONAI | ★ 8.4k | PyTorch-based open-source framework for deep learning in healthcare imaging, from domain-specific data loaders to pretrained model zoos. |
| MedSAM | ★ 4.3k | Segment Anything foundation model adapted for promptable segmentation across diverse medical imaging modalities. |
| TotalSegmentator | ★ 2.9k | Segment major anatomical structures in CT and MR scans |
| NeuroVFM | ★ 46 | Neuroimaging visual foundation model trained on 5.24M clinical MRI/CT volumes via self-supervised Vol-JEPA, covering 156 diagnostic tasks across both modalities. |