Repository navigation
Releases
totalsegmentator-mlx 0.3.0
Breaking changes
Requires nnunet-mlx 0.9 and medmlx-core 0.3. run returns {"outputs", "artifacts", "details"}; the mask artifact is a label map on the input grid that lists the structures the run can write.
run and load_model are the whole Python API. segment(), configure_predictor_cache(), clear_predictor_cache() and predictor_cache_info() are removed, and prompt is now classes.
-from totalsegmentator_mlx import segment
-labels = segment("ct.nii.gz", model_dir="models", prompt=["liver"])
+from totalsegmentator_mlx import run
+result = run(image_path="ct.nii.gz", output_dir="out", classes=["liver"])predict writes into a folder. It takes -o/--output-dir and --weights (downloads by default) instead of -o/--output and --model-dir, --organ is --classes, and --probabilities replaces --probabilities-path.
New
load_model() keeps the networks loaded across several CTs. with load_model() as model: model.run(...) takes run's arguments except weights_path.
run accepts model_part, force_split and probabilities. With probabilities=True it also writes probabilities.npz and probabilities.pkl for one uncropped model.
Fixes
The mask and its sidecar files are published together. An interrupted run no longer leaves a mask without its sidecars, or the reverse.
totalsegmentator-mlx 0.2.0
Breaking changes
Requires nnunet-mlx 0.8. Its resampling now rounds as nnU-Net does, so results can differ from 0.1.9 where that rounding applies.
New
configure_predictor_cache(max_bytes=..., max_entries=...) bounds the cached nnU-Net predictors. clear_predictor_cache() and predictor_cache_info() manage the cache; the default still keeps eight predictors, and a model larger than the byte budget runs uncached.
Lower memory
--probabilities-path no longer writes and rereads a temporary compressed CT. Predictions come back in memory, and the NPZ and PKL files are staged privately before either destination is replaced.
Large CTs are split into slabs without a full float64 copy of the volume.
totalsegmentator-mlx 0.1.9
medmlx now checks that totalsegmentator fits in available memory before running it. The runtime declares a 5.0 GB peak, and the README lists the 824 MB weight download and the measured peak.
totalsegmentator-mlx 0.1.8
Accepts any nnunet-mlx 0.7.x instead of exactly 0.7.0, so medmlx installs can move to nnunet-mlx 0.7.1 and its SIAM model. TotalSegmentator's labels are identical under 0.7.0 and 0.7.1.
totalsegmentator-mlx 0.1.7
Breaking changes
Requires nnunet-mlx 0.7.0 instead of 0.6.4, so it installs alongside the nnU-Net models in medmlx 0.4.5. If you also use nnunet-mlx directly, its breaking changes apply.
Fixes
probabilities outputs no longer write through a symlink at the destination. They are staged in a private folder and renamed into place, as the mask already was. A dangling symlink at any output path now counts as an existing output, rejected unless overwrite is set.
totalsegmentator-mlx 0.1.6
First release: segment 117 CT structures with TotalSegmentator v2 in native MLX.