health. Not a medical device and not intended for clinical usage, as the README says.
Who it is forA team building a cohort study that needs numbers, not just masks.
The problemReading volumes off masks by hand does not scale across a cohort.
The outcomeA statistics.json with volume in cubic millimetres and mean intensity per class.
What you need first
- Python 3.10 or newer and PyTorch 2.0.0 or newer
- A Nifti file, or a folder or zip of all DICOM slices of one patient, as input
- A GPU for reasonable runtime; CPU works with the --fast or --roi_subset options
- A free non-commercial license number for the non-open tasks and for totalseg_get_body_stats
Steps
- Install it with
pip install TotalSegmentator - Run Total Segmentator with the
--statisticsoption to write statistics.json next to the segmentations - If structures that touch the image border report zero, rerun with
TotalSegmentator -i ct.nii.gz -o seg --statistics --stats_include_incomplete - Use
--statistics_extrawhen you also want n_voxels, intensity std, min and max, centroid_vox and bbox_vox
Prompt for your agent
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.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for wasserth/TotalSegmentator and "Measure organ volumes and intensities automatically"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer