Skip to main content

A Candy for Medical Image Processing

Project description

MIP Candy: A Candy for Medical Image Processing

PyPI GitHub Release PyPI Downloads GitHub Stars

poster

MIP Candy is Project Neura's next-generation infrastructure framework for medical image processing. It defines a handful of common network architectures with their corresponding training, inference, and evaluation pipelines that are out-of-the-box ready to use. Additionally, it also provides integrations with popular frontend dashboards such as Notion, WandB, and TensorBoard.

We provide a flexible and extensible framework for medical image processing researchers to quickly prototype their ideas. MIP Candy takes care of all the rest, so you can focus on only the key experiment designs.

:link: Home

:link: Docs

Citation

Should you find our work helpful to you, please cite our publication.

@misc{fu2026mipcandymodularpytorch,
    title = {MIP Candy: A Modular PyTorch Framework for Medical Image Processing},
    author = {Tianhao Fu and Yucheng Chen},
    year = {2026},
    eprint = {2602.21033},
    archivePrefix = {arXiv},
    primaryClass = {cs.CV},
    url = {https://arxiv.org/abs/2602.21033},
}

Installation

Note that MIP Candy requires Python >= 3.12.

pip install "mipcandy[standard]"

Quick Start

Below is an example using the ACDC dataset. The example code replicates most of nnU-Net's features but without augmentations.

from typing import override
from os.path import exists

from monai.networks.nets import DynUNet
from torch import nn
from torch.utils.data import DataLoader

from mipcandy import SegmentationTrainer, AmbiguousShape, auto_device, download_dataset, NNUNetDataset, inspect, \
    load_inspection_annotations, RandomROIDataset


class UNetTrainer(SegmentationTrainer):
    @override
    def build_network(self, example_shape: AmbiguousShape) -> nn.Module:
        kernel_size = [[3, 3, 3]] * 5
        strides = [[1, 1, 1]] + [[2, 2, 2]] * 4
        return DynUNet(spatial_dims=3, in_channels=example_shape[0], out_channels=self.num_classes,
                       kernel_size=kernel_size, strides=strides, upsample_kernel_size=strides,
                       deep_supervision=self.deep_supervision, deep_supr_num=2, res_block=True)


if __name__ == "__main__":
    device = auto_device()
    download_dataset("nnunet_datasets/ACDC", "tutorial/datasets/ACDC")
    dataset = NNUNetDataset("tutorial/datasets/ACDC", align_spacing=True)
    if exists("tutorial/datasets/ACDC/annotations.json"):
        annotations = load_inspection_annotations("tutorial/datasets/ACDC/annotations.json", dataset)
    else:
        dataset.device(device=device)
        annotations = inspect(dataset)
        dataset.device(device="cpu")
        annotations.save("tutorial/datasets/ACDC/annotations.json")
    dataset = RandomROIDataset(annotations, 2)
    train, val = dataset.fold()
    train_loader = DataLoader(train, 2, True, num_workers=2, prefetch_factor=2, persistent_workers=True)
    val_loader = DataLoader(val, 1, False)
    trainer = UNetTrainer("tutorial", train_loader, val_loader, device=device)
    trainer.train(1000, note="example with the ACDC dataset")

Project details


Download files

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

Source Distribution

mipcandy-1.1.1b1.tar.gz (40.6 kB view details)

Uploaded Source

Built Distribution

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

mipcandy-1.1.1b1-py3-none-any.whl (53.9 kB view details)

Uploaded Python 3

File details

Details for the file mipcandy-1.1.1b1.tar.gz.

File metadata

  • Download URL: mipcandy-1.1.1b1.tar.gz
  • Upload date:
  • Size: 40.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mipcandy-1.1.1b1.tar.gz
Algorithm Hash digest
SHA256 a5f29d6876aee1bbd5266912757426811e7930c0e668dab01e7fe71f99b49df3
MD5 a21d6a820d4dfbedd5d30c63453dca0d
BLAKE2b-256 7e209f359059c6d6f48dfedef6a536e79c6ce94a97d51d9428e4906eae9e32ff

See more details on using hashes here.

Provenance

The following attestation bundles were made for mipcandy-1.1.1b1.tar.gz:

Publisher: python-publish.yml on ProjectNeura/MIPCandy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mipcandy-1.1.1b1-py3-none-any.whl.

File metadata

  • Download URL: mipcandy-1.1.1b1-py3-none-any.whl
  • Upload date:
  • Size: 53.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mipcandy-1.1.1b1-py3-none-any.whl
Algorithm Hash digest
SHA256 5c0a2985f17233197cbe87286f7da97c723fe285023e012d4800dde5275b1fa7
MD5 dde3884a53a2bd0e3bdd82bf008dad7d
BLAKE2b-256 0cefab02a295a8ff571f8e867303543bdcfd183a6806177c0e85e3f3f8a8e336

See more details on using hashes here.

Provenance

The following attestation bundles were made for mipcandy-1.1.1b1-py3-none-any.whl:

Publisher: python-publish.yml on ProjectNeura/MIPCandy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page