Metadata-Version: 2.5
Name: mlx-segment-ct
Version: 0.3.1
Summary: Native MLX implementation of NV-Segment-CT (VISTA-3D)
Project-URL: Homepage, https://huggingface.co/MedMLX/vista3d-ct-mlx
Author: Joseph Sandoval, Alfredo Sandoval Jr.
License-Expression: Apache-2.0 AND BSD-3-Clause
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.5
Requires-Dist: nibabel<6,>=5.3
Requires-Dist: numpy<3,>=2.0
Requires-Dist: scipy<2,>=1.14
Provides-Extra: dev
Requires-Dist: einops<1,>=0.8; extra == 'dev'
Requires-Dist: hypothesis<7,>=6.140; extra == 'dev'
Requires-Dist: monai==1.6.1; 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'
Requires-Dist: scikit-image<1,>=0.25; extra == 'dev'
Requires-Dist: scipy-stubs==1.18.1.1; extra == 'dev'
Requires-Dist: torch<3,>=2.13; extra == 'dev'
Description-Content-Type: text/markdown

# mlx-segment-ct

Segment CT anatomy automatically or with anatomy names and clicks, using NVIDIA VISTA-3D in native MLX.

[CT weights](https://huggingface.co/MedMLX/vista3d-ct-mlx) · [CTMR weights](https://huggingface.co/MedMLX/vista3d-ctmr-mlx)

| Input | Output |
| :--- | :--- |
| 3D CT · NIfTI | Anatomical labels on the input grid |

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

## Quick start

```bash
uv pip install "mlx-segment-ct>=0.3.1"
```

The click coordinates below are examples: replace them with voxels inside your
image and its preprocessed foreground crop. `1` includes a point; `0` excludes it.

```python
from mlx_segment_ct.medmlx import run

run(image_path="ct.nii.gz", output_dir="all")
run(image_path="ct.nii.gz", output_dir="organs", prompt="liver, spleen")
run(
    image_path="ct.nii.gz", output_dir="points",
    points=[[40, 50, 30], [44, 51, 30]], point_labels=[1, 0],
)
```

Omitting `weights_path` downloads `MedMLX/vista3d-ct-mlx` once and reuses its local
cache. An explicit model folder contains `automatic.safetensors` and
`correction.safetensors`. Point coordinates are `(x, y, z)` voxels.

The registered `mlx-segment-ctmr` model uses `mlx_segment_ct.medmlx.run_ctmr` and its
own `MedMLX/vista3d-ctmr-mlx` folder, with CTMR preprocessing and labels selected
internally. The advanced `run(checkpoint="NV-Segment-CTMR", ...)`
interface still accepts an explicitly supplied matching folder. It never substitutes
CT weights for CTMR.

The published [NV-Segment-CTMR weights](https://huggingface.co/MedMLX/vista3d-ctmr-mlx)
cover CT and MRI under noncommercial terms. NVIDIA does not support interactive
point segmentation with that checkpoint.

Downloaded commits are returned in `details.weights_revision`; explicit local
weights report `null` unless the folder carries a MedMLX download revision.

## License

Apache-2.0; license and third-party notices are included in the distribution. Model weights retain their publisher terms.

For research and education. Outputs require human review.
