MIST: A simple, scalable, and end-to-end 3D medical imaging segmentation framework.
3.5K
MIST is a simple, scalable, end-to-end framework for 3D medical image segmentation. It handles everything from raw NIfTI files to trained models and evaluated predictions, with sensible defaults that work well out of the box and a configuration file for when you need more control.
Tip
**Try MIST in your browser — no setup required.** The [**end-to-end Colab demo**](https://colab.research.google.com/github/mist-medical/MIST/blob/main/examples/mist_heart_demo.ipynb) runs the whole pipeline — analyze → preprocess → train → evaluate → predict → postprocess → rank → visualize — on a heart MRI dataset using a free Colab T4 GPU.
pip install mist-medical
This works on CPUs and NVIDIA GPUs. For AMD GPUs, install a ROCm build of
PyTorch first (see Accelerator support).
Docker: docker pull mistmedical/mist:latest. Upgrading from 2.x? See
Upgrading to 3.0.
1. Prepare a dataset JSON describing your data:
{
"task": "brats2023",
"modality": "mr",
"train-data": "/full/path/to/raw/data/train",
"test-data": "/full/path/to/raw/data/validation",
"mask": ["seg.nii.gz"],
"images": {
"t1": ["t1n.nii.gz"],
"t2": ["t2w.nii.gz"],
"tc": ["t1c.nii.gz"],
"fl": ["t2f.nii.gz"]
},
"labels": [0, 1, 2, 3],
"final_classes": { "WT": [1, 2, 3], "TC": [1, 3], "ET": [3] }
}
2. Run the full pipeline (analyze → preprocess → train → evaluate):
mist_run_all --data dataset.json \
--numpy /path/to/numpy \
--results /path/to/results
3. Run inference on new data:
mist_predict --models-dir /path/to/results/models \
--config /path/to/results/config.json \
--paths-csv /path/to/test.csv \
--output /path/to/predictions
mist_train included,
runs on any machine, including Macs and laptops without an NVIDIA GPU| Model | Variants |
|---|---|
| nnU-Net | nnunet-plain (default), nnunet-plain-pocket, nnunet-res (alias nnunet), nnunet-res-pocket (alias nnunet-pocket) |
| ResEnc UNet | resenc, resenc-pocket |
| MedNeXt | mednext-small, mednext-base, mednext-medium, mednext-large |
| SwinUNETR-V2 | swinunetr-small, swinunetr-base, swinunetr-large |
| Primus | primus-medium, primus-large, primus-x |
| PrimusV2 | primusv2-small, primusv2-base, primusv2-medium, primusv2-large |
| FMG-Net | fmgnet |
| W-Net | wnet |
Change the architecture in config.json or pass --model <key> at the command
line.
| Loss | Key | Notes |
|---|---|---|
| Dice | dice | |
| Dice + Cross-Entropy | dice_ce | |
| clDice | cldice | Composite |
| Boundary Loss | bl | Composite |
| Generalized Surface Loss | gsl | Composite |
| Hausdorff Distance One-Sided | hdos | Composite |
| Volumetric SDDL | volumetric_sddl | Composite |
| Vessel SDDL | vessel_sddl | Composite |
Composite losses blend a region-based term with a boundary/distance term,
weighted by a scheduled alpha. Schedules: constant, linear, cosine.
| Command | Description |
|---|---|
mist_run_all | Run the full pipeline end-to-end |
mist_analyze | Analyze dataset and generate config.json |
mist_preprocess | Preprocess images into NumPy arrays |
mist_train | Train models |
mist_finalize | Aggregate out-of-fold predictions into results.csv and run test-set inference |
mist_predict | Run inference on new data |
mist_ensemble | Combine predictions from multiple models via STAPLE, majority vote, or probability averaging |
mist_evaluate | Evaluate predictions against ground truth |
mist_postprocess | Apply postprocessing strategies |
mist_rank | Rank multiple evaluation result CSVs BraTS-style |
mist_average_weights | Average model weights across folds |
mist_convert_msd | Convert Medical Segmentation Decathlon datasets |
mist_convert_csv | Convert CSV-formatted datasets |
Full documentation, including configuration reference and advanced topics, is at mist-medical.readthedocs.io.
nnunet-plain is the new default network. In a matched five-fold comparison
on LiTS, MIST ranked ahead of nnU-Net overall and matched it on tumors. Models
trained with 2.x keep working; see
Upgrading to 3.0.resenc), Primus, and
PrimusV2 architectures, and fine-tuning from the openly available
nnFoundationCNN and nnFoundationViT pretrained encoders with
--pretrained-weights. Try it in the
fine-tuning notebook.mist_finalize for per-fold distributed training, probability-level
and parallel ensembling, and no more ANTs dependency.See the changelog for the full release history.
If you use MIST in your work, please cite:
@article{celaya2024mist,
title = {MIST: A Simple and Scalable End-To-End 3D Medical Imaging Segmentation Framework},
author = {Celaya, Adrian and others},
journal = {arXiv preprint arXiv:2407.21343},
year = {2024}
}
@article{celaya2022pocketnet,
title = {PocketNet: A Smaller Neural Network For Medical Image Analysis},
author = {Celaya, Adrian and others},
journal = {IEEE Transactions on Medical Imaging},
doi = {10.1109/TMI.2022.3224873},
year = {2022}
}
docker pull mistmedical/mist:latest