Sign inSign up

mistmedical/mist

By mistmedical

•Updated 1 day ago

MIST: A simple, scalable, and end-to-end 3D medical imaging segmentation framework.

Image
Machine learning & AI
0

3.0K

mistmedical/mist repository overview

⁠Medical Imaging Segmentation Toolkit

GitHub Actions Workflow Status Docs GitHub Repo stars Coverage

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.

Open In Colab

⁠Installation

CPU (default — runs the full pipeline: train, predict, evaluate, everything):

pip install mist-medical

NVIDIA GPU (recommended — adds DALI-accelerated data loading):

pip install "mist-medical[dali]"

Note

Upgrading from an older MIST release? `pip install "mist-medical[train]"` still works too — it's kept as an identical alias for `[dali]`, so nothing in an existing script or notebook breaks.

AMD ROCm GPU (install a ROCm-enabled PyTorch build first — PyPI's default torch wheel has no ROCm support — matching your driver's ROCm version, then MIST on top with no extra needed; see Accelerator support⁠ for details):

pip install torch --index-url https://download.pytorch.org/whl/rocm6.4
pip install mist-medical

Development:

git clone https://github.com/mist-medical/MIST.git
cd MIST
pip install -e .            # CPU
pip install -e ".[dali]"    # NVIDIA GPU acceleration (recommended on CUDA)

Docker (NVIDIA GPU required, driver ≥ 525.x):

docker pull mistmedical/mist:latest

⁠Quick Start

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

⁠Key Features

  • Automatic configuration — analysis step determines target spacing, patch size, normalization, and foreground cropping from your data
  • Five-fold cross-validation by default, with custom fold assignment support
  • Multi-GPU training via PyTorch DDP on NVIDIA CUDA or AMD ROCm; uses all visible GPUs automatically
  • GPU-accelerated data loading via NVIDIA DALI during training, with a generic CPU-based data loader used automatically on AMD ROCm or CPU-only hardware — no NVIDIA-specific dependencies required to train at all
  • Sliding window inference with configurable overlap and patch blending
  • Test-time augmentation and multi-model ensembling at inference
  • Postprocessing with learnable, per-class morphological strategies
  • CPU training and inference — the full pipeline, mist_train included, runs on any machine, including Macs and laptops without an NVIDIA GPU

⁠Supported Architectures

ModelKey
nnU-Net (default)nnunet-plain
nnU-Net Residualnnunet-res, nnunet
nnU-Net Pocketnnunet-pocket
ResEnc UNetresenc
Primus (medium / large / X)primus-medium, primus-large, primus-x
PrimusV2 (small / base / medium / large)primusv2-small, primusv2-base, primusv2-medium, primusv2-large
MedNeXt (small / base / medium / large)mednext-small, mednext-base, mednext-medium, mednext-large
FMG-Netfmgnet
W-Netwnet
Swin UNETR (small / base / large)swinunetr-small, swinunetr-base, swinunetr-large

Change the architecture in config.json or pass --model <key> at the command line.

⁠Supported Loss Functions

LossKeyNotes
Dicedice
Dice + Cross-Entropydice_ce
clDicecldiceComposite
Boundary LossblComposite
Generalized Surface LossgslComposite
Hausdorff Distance One-SidedhdosComposite
Volumetric SDDLvolumetric_sddlComposite
Vessel SDDLvessel_sddlComposite

Composite losses blend a region-based term with a boundary/distance term, weighted by a scheduled alpha. Schedules: constant, linear, cosine.

⁠Pipeline Commands

CommandDescription
mist_run_allRun the full pipeline end-to-end
mist_analyzeAnalyze dataset and generate config.json
mist_preprocessPreprocess images into NumPy arrays
mist_trainTrain models
mist_finalizeAggregate out-of-fold predictions into results.csv and run test-set inference
mist_predictRun inference on new data
mist_ensembleCombine predictions from multiple models via STAPLE, majority vote, or probability averaging
mist_evaluateEvaluate predictions against ground truth
mist_postprocessApply postprocessing strategies
mist_rankRank multiple evaluation result CSVs BraTS-style
mist_average_weightsAverage model weights across folds
mist_convert_msdConvert Medical Segmentation Decathlon datasets
mist_convert_csvConvert CSV-formatted datasets

⁠Documentation

Full documentation, including configuration reference and advanced topics, is at mist-medical.readthedocs.io⁠.

⁠What's New

  • November 2026 — MIST 2.4.0 — new ResEnc UNet (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⁠.
  • October 2026 — MIST 2.3.0, the first stable release — CPU and AMD ROCm training, mist_finalize for per-fold distributed training, probability-level and parallel ensembling, and no more ANTs dependency. pip install --upgrade mist-medical, or pip install --upgrade "mist-medical[dali]" for DALI-accelerated data loading on NVIDIA GPUs (highly recommended).
  • July 2026 — Interactive Colab demo — run the full pipeline on a free Colab GPU with the heart segmentation notebook⁠.
  • 2024 and 2025 — 3rd place in the BraTS adult glioma challenge at MICCAI 2024⁠ and MICCAI 2025⁠.

See the changelog⁠ for the full release history.

⁠Citation

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}
}

Tag summary

Content type

Image

Digest

sha256:1ba0bc8eb…

Size

4.8 GB

Last updated

2 days ago

docker pull mistmedical/mist