Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

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

Training (NVIDIA GPU required):

pip install "mist-medical[train]"

Inference only (CPU-compatible):

pip install mist-medical

Development:

git clone https://github.com/mist-medical/MIST.git
cd MIST
pip install -e ".[train]"    # full
pip install -e .             # inference only

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; uses all visible GPUs automatically
  • GPU-accelerated data loading via NVIDIA DALI during training
  • 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 inferencemist_predict runs on any machine, including Macs

Supported Architectures

Model Key
nnU-Net nnunet
nnU-Net Pocket nnunet-pocket
MedNeXt (small / base / medium / large) mednext-small, mednext-base, mednext-medium, mednext-large
FMG-Net fmgnet
W-Net wnet
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

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.

Pipeline Commands

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_predict Run inference on new data
mist_ensemble Combine predictions from multiple models via STAPLE or majority vote
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

Documentation

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

What's New

  • July 2026 — Interactive Colab demo — run the full MIST pipeline end-to-end on a free Colab GPU with the heart segmentation notebook: analysis, training, evaluation, inference, postprocessing, and BraTS-style ranking, all in the browser with no local setup.
  • June 2026 — Official Docker imagemistmedical/mist:latest ships a CUDA 12.8 build. Requires NVIDIA driver ≥ 525.x.
  • June 2026 — 2.0.1 release candidate — BF16 automatic mixed precision replaces FP16 throughout training and inference, reducing memory use and eliminating gradient loss scaling. Sliding-window inference gains a tunable sw_batch_size parameter. mist_rank adds pairwise Wilcoxon significance testing via --significance-csv. Several targeted memory-reduction fixes land across the inference stack.
  • June 2026 — Multi-model ensemblingmist_ensemble combines discrete NIfTI predictions from two or more separately trained models into a single consensus segmentation via STAPLE (--ensemble-backend staple, default) or majority vote (--ensemble-backend majority_vote). Works for single-class and multi-class label maps.
  • May 2026 — 2.0.0 release candidate — BraTS-style multi-strategy ranking (mist_rank), a structured postprocessing transform registry with LLM-readable metadata (describe_transforms), and full pathlib + PEP 585/604 modernization across the codebase.
  • April 2026 — CPU inference supportmist_predict now runs on any machine, including Macs and laptops without an NVIDIA GPU. Install with pip install mist-medical (no GPU required).
  • March 2026 — Resume training — interrupted runs can be continued from the last checkpoint with --resume, with atomic checkpointing to prevent corruption.
  • March 2026 — GPU-aware automatic patch size — the analysis step now derives the patch size from available GPU memory, so the default configuration is hardware-appropriate without manual tuning.
  • March 2026 — Transfer learning — initialize encoders from pretrained weights with --pretrained-weights, and average model weights across folds with mist_average_weights.
  • March 2026 — Better training defaults — AdamW optimizer and gradient clipping are now the defaults, with the clipping threshold exposed via grad_clip_norm in config.json.
  • September 2025 — BraTS 2025 adult glioma challenge @ MICCAI 2025 — MIST takes 3rd place (repeat).
  • November 2024 — MedNeXt models — small, base, medium, and large variants added (mednext-small, mednext-base, mednext-medium, mednext-large).
  • October 2024 — BraTS 2024 adult glioma challenge @ MICCAI 2024 — MIST takes 3rd place.

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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mist_medical-2.0.2rc0.tar.gz (180.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mist_medical-2.0.2rc0-py3-none-any.whl (227.9 kB view details)

Uploaded Python 3

File details

Details for the file mist_medical-2.0.2rc0.tar.gz.

File metadata

  • Download URL: mist_medical-2.0.2rc0.tar.gz
  • Upload date:
  • Size: 180.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for mist_medical-2.0.2rc0.tar.gz
Algorithm Hash digest
SHA256 7f046a4e2bd08257d1b3dd5aad66f63a8a830b729784997f13538f2e50618ef9
MD5 4d5d23b4ff39b5924b7c471b311756e6
BLAKE2b-256 032d38269ac2703d1164f32645d93c0566c055468d13db5a2cea507cb7211f22

See more details on using hashes here.

File details

Details for the file mist_medical-2.0.2rc0-py3-none-any.whl.

File metadata

File hashes

Hashes for mist_medical-2.0.2rc0-py3-none-any.whl
Algorithm Hash digest
SHA256 adc8336c4b683153a6bc75edff901d920c4a96ff75c7f4d8cdc6db28b4ab4b86
MD5 7891ca4d4e269ee663c40759049db7f5
BLAKE2b-256 0ef00720c61462582cf1e5f80031592ade7bd1cb1b3c84b0953f5bdd21e33df5

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

2.0.2rc0 This release

2 files

0.4.20a0

2 files

0.4.19a0

2 files

0.4.18a0

2 files

0.4.16a0

2 files

0.4.15a0

2 files

0.4.14a0

2 files

0.4.12a0

2 files

0.4.11a0

2 files

0.4.10a0

2 files

0.4.9a0

2 files

0.4.8a0

2 files

0.4.7a0

2 files

0.4.6a0

2 files

0.4.5a0

2 files

0.4.4a0

2 files

0.1.0b0

2 files

0.0.2b0

2 files

0.0.1b0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page