# AI use cases for Total Segmentator (wasserth/TotalSegmentator)

Repo: [wasserth/TotalSegmentator](https://github.com/wasserth/TotalSegmentator) | Use cases: 3 | Page: https://dedupedai.com/use-cases/wasserth-totalsegmentator/

TotalSegmentator segments most major anatomical structures in any CT or MR image from the command line. The default total task covers 117 classes on CT and total_mr covers 50 on MR, with dozens of subtasks for vessels, head and neck, teeth, liver segments and more. Extra commands predict body stats, contrast phase and modality, and it can write per class volume statistics or DICOM output.

This file holds every use case of this repo. Each one starts with a "## " heading and ends with its URL.

- Get organ masks from a CT or MR scan in one command: https://dedupedai.com/use-cases/wasserth-totalsegmentator/segment-anatomy-in-a-ct-scan-with-totalsegmentator/
- Measure organ volumes and intensities automatically: https://dedupedai.com/use-cases/wasserth-totalsegmentator/measure-organ-volumes-with-totalsegmentator-statistics/
- Find the right task and class names before you run: https://dedupedai.com/use-cases/wasserth-totalsegmentator/list-totalsegmentator-tasks-and-classes-for-a-script/

## How to get organ masks from a CT or MR scan in one command with Total Segmentator

Repo: [wasserth/TotalSegmentator](https://github.com/wasserth/TotalSegmentator) | Difficulty: Intermediate | Time: 1 hour | Basis: From the README

Run the default task to write one segmentation file per anatomical class.

**Who it is for:** A researcher starting an imaging study who needs structures labeled.

**The problem:** Manual contouring of organs takes hours per scan.

**The outcome:** A folder of segmentation files, one per class, for your scan.

### Steps

1. Install it with `pip install TotalSegmentator`
2. For CT run `TotalSegmentator -i ct.nii.gz -o segmentations`
3. For MR run `TotalSegmentator -i mri.nii.gz -o segmentations --task total_mr`
4. On CPU add `--fast` or `--roi_subset`, and on an M series Mac use `--device mps`

### Prompt to paste into your agent

```text
Using wasserth/TotalSegmentator, install it with `pip install TotalSegmentator`, run `TotalSegmentator -i ct.nii.gz -o segmentations` on <my scan>, and summarize which classes came out nonempty.
```

### Caveat

Weights download automatically on the first run, so the first scan is slower.

Risk, health: The README states this is not a medical device and is not intended for clinical usage.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/wasserth-totalsegmentator/segment-anatomy-in-a-ct-scan-with-totalsegmentator/

## How to measure organ volumes and intensities automatically with Total Segmentator

Repo: [wasserth/TotalSegmentator](https://github.com/wasserth/TotalSegmentator) | Difficulty: Intermediate | Time: 1 hour | Basis: From the README

Add the statistics flag so each segmented class comes with its volume and mean intensity.

**Who it is for:** A team building a cohort study that needs numbers, not just masks.

**The problem:** Reading volumes off masks by hand does not scale across a cohort.

**The outcome:** A statistics.json with volume in cubic millimetres and mean intensity per class.

### Steps

1. Install it with `pip install TotalSegmentator`
2. Run Total Segmentator with the `--statistics` option to write statistics.json next to the segmentations
3. If structures that touch the image border report zero, rerun with `TotalSegmentator -i ct.nii.gz -o seg --statistics --stats_include_incomplete`
4. Use `--statistics_extra` when you also want n_voxels, intensity std, min and max, centroid_vox and bbox_vox

### Prompt to paste into your agent

```text
With wasserth/TotalSegmentator, run the total task on every scan in <my folder> with `--statistics`, then build one CSV of per organ volumes across the cohort.
```

### Caveat

By default a structure whose mask reaches the image border is treated as incomplete and reported as zero.

Risk, health: Not a medical device and not intended for clinical usage, as the README says.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/wasserth-totalsegmentator/measure-organ-volumes-with-totalsegmentator-statistics/

## How to find the right task and class names before you run with Total Segmentator

Repo: [wasserth/TotalSegmentator](https://github.com/wasserth/TotalSegmentator) | Difficulty: Beginner | Time: 20 minutes | Basis: From the README

Use totalseg_info to print the available tasks and their classes without downloading weights.

**Who it is for:** A developer or coding agent wiring Total Segmentator into a pipeline.

**The problem:** Guessing task and class names wastes whole GPU runs.

**The outcome:** An exact list of tasks and class names, as a table or as JSON.

### Steps

1. Install it with `pip install TotalSegmentator`
2. Run `totalseg_info --list-tasks` for a table of tasks with modality, license and number of classes
3. Run `totalseg_info --classes -ta total` to see the class index to name mapping for one task
4. Run `totalseg_info --json` to get the full capability registry as JSON for your script

### Prompt to paste into your agent

```text
Using wasserth/TotalSegmentator, run `totalseg_info --json` and write me a small Python helper that picks the right task and `--roi_subset` names for <the structures I care about>.
```

### Caveat

Some subtasks need a license number set with totalseg_set_license, which is free for non-commercial use.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/wasserth-totalsegmentator/list-totalsegmentator-tasks-and-classes-for-a-script/
