Metadata-Version: 2.5
Name: totalsegmentator-mlx
Version: 0.1.2.post1
Summary: TotalSegmentator v2 CT segmentation with native MLX inference on Apple Silicon
Project-URL: Homepage, https://github.com/MedMLX/totalsegmentator-mlx
Project-URL: Documentation, https://github.com/MedMLX/totalsegmentator-mlx/blob/main/docs/technical.md
Project-URL: Repository, https://github.com/MedMLX/totalsegmentator-mlx
Project-URL: Issues, https://github.com/MedMLX/totalsegmentator-mlx/issues
Author: Joseph Sandoval, Alfredo Sandoval Jr.
License-Expression: Apache-2.0
License-File: LICENSE
License-File: THIRD_PARTY_NOTICES.md
Classifier: Operating System :: MacOS :: MacOS X
Requires-Python: <3.15,>=3.13
Requires-Dist: medmlx-core==0.2.4
Requires-Dist: nibabel<6,>=5.3
Requires-Dist: nnunet-mlx==0.5.2
Requires-Dist: numpy<3,>=2.0
Requires-Dist: scipy==1.18.1
Provides-Extra: conversion
Requires-Dist: nnunet-mlx[conversion]; extra == 'conversion'
Provides-Extra: dev
Requires-Dist: hypothesis<7,>=6; extra == 'dev'
Requires-Dist: pyright==1.1.414; extra == 'dev'
Requires-Dist: pytest<10,>=8.4; extra == 'dev'
Requires-Dist: ruff<1,>=0.13; extra == 'dev'
Description-Content-Type: text/markdown

# totalsegmentator-mlx

Segment 117 CT structures with TotalSegmentator v2 in native MLX. Includes standard, fast and coarse modes.

[Docs](https://github.com/MedMLX/totalsegmentator-mlx/blob/main/docs/technical.md) · [MedMLX](https://github.com/MedMLX)

![Standard-mode 3D surfaces and axial CT segmentation](https://raw.githubusercontent.com/MedMLX/totalsegmentator-mlx/22cccf09c4380a5e0b0ea8b8de6cbd2f23830b4f/docs/example-standard.png)

*Standard-mode 3D surfaces from [autoPET-III](https://huggingface.co/datasets/YongchengYAO/autoPET-III-Lite) (CC BY-NC 4.0) and an axial slice from [AMOS22](https://zenodo.org/records/7262581) (Ji et al.). Surfaces and contours are smoothed for display.*

| Input | Output |
| :--- | :--- |
| 3D CT · NIfTI | Multilabel mask on the input grid |

**Apple Silicon · Metal · Python 3.13 / 3.14** · [uv](https://docs.astral.sh/uv/)

## Quick start

```bash
uv venv --python 3.13
source .venv/bin/activate
uv pip install "totalsegmentator-mlx[conversion]"
```

Convert the TotalSegmentator v2 checkpoints once, then segment:

```bash
totalsegmentator-mlx convert --source-model-dir ~/.totalsegmentator/nnunet/results \
  --output-model-dir models --models organs vertebrae cardiac muscles ribs
totalsegmentator-mlx predict -i ct.nii.gz -o mask.nii.gz --model-dir models
```

Get the checkpoints from [TotalSegmentator](https://github.com/wasserth/TotalSegmentator). Docs cover model folders, modes and cropping.

## License

[Apache-2.0](https://github.com/MedMLX/totalsegmentator-mlx/blob/main/LICENSE). See [third-party notices](https://github.com/MedMLX/totalsegmentator-mlx/blob/main/THIRD_PARTY_NOTICES.md). Model weights retain their publisher terms.

For research and education. Outputs require human review.
