Metadata-Version: 2.5
Name: totalsegmentator-mlx
Version: 0.1.1
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.3
Requires-Dist: nibabel<6,>=5.3
Requires-Dist: nnunet-mlx==0.5.1
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)

![totalsegmentator-mlx example output](https://raw.githubusercontent.com/MedMLX/totalsegmentator-mlx/main/docs/example.png)

*Fast-mode 3D surfaces and an axial slice from an autoPET CT.*

| 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 --seed
source .venv/bin/activate
python -m pip install "totalsegmentator-mlx[conversion]==0.1.1"
```

Convert your 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
```

The PyPI package contains code only. Obtain trusted TotalSegmentator v2 checkpoints
from [upstream](https://github.com/wasserth/TotalSegmentator) under their publisher
terms, then convert your local copies. No checkpoints are downloaded automatically.
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.
