Skip to main content

A Candy for Medical Image Processing

Project description

MIP Candy: A Candy for Medical Image Processing

GitHub code size in bytes PyPI GitHub Release GitHub Release Date - Published_At

poster

MIP Candy is Project Neura's next-generation infrastructure framework for medical image processing. It integrates a handful number 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 adapters to popular frontend dashboards such as Notion, WandB, and TensorBoard.

:link: Home

:link: Docs

Key Features

Why MIP Candy? :thinking:

Easy adaptation to fit your needs We provide tons of easy-to-use techniques for training that seamlessly support your customized experiments.
  • Sliding window
  • ROI inspection
  • ROI cropping to align dataset shape (100% or 33% foreground)
  • Automatic padding
  • ...

You only need to override one method to create a trainer for your network architecture.

from typing import override

from torch import nn
from mipcandy import SegmentationTrainer


class MyTrainer(SegmentationTrainer):
    @override
    def build_network(self, example_shape: tuple[int, ...]) -> nn.Module:
        ...
Satisfying command-line UI design cmd-ui
Built-in 2D and 3D visualization for intuitive understanding visualization
High availability with interruption tolerance Interrupted experiments can be resumed with ease. recovery
Support of various frontend platforms for remote monitoring

MIP Candy Supports Notion, WandB, and TensorBoard.

notion

Installation

Note that MIP Candy requires Python >= 3.12.

pip install "mipcandy[standard]"

Quick Start

Below is a simple example of a nnU-Net style training. The batch size is set to 1 due to the varying shape of the dataset.

from typing import override

import torch
from mipcandy_bundles.unet import UNetTrainer
from torch.utils.data import DataLoader

from mipcandy import download_dataset, NNUNetDataset


class PH2(NNUNetDataset):
    @override
    def load(self, idx: int) -> tuple[torch.Tensor, torch.Tensor]:
        image, label = super().load(idx)
        return image.squeeze(0).permute(2, 0, 1), label


download_dataset("nnunet_datasets/PH2", "tutorial/datasets/PH2")
dataset, val_dataset = PH2("tutorial/datasets/PH2", device="cuda").fold()
dataloader = DataLoader(dataset, 1, shuffle=True)
val_dataloader = DataLoader(val_dataset, 1, shuffle=False)
trainer = UNetTrainer("tutorial", dataloader, val_dataloader, device="cuda")
trainer.train(1000, note="a nnU-Net style example")

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.0b0.tar.gz (34.2 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.0b0-py3-none-any.whl (47.0 kB view details)

Uploaded Python 3

File details

Details for the file mipcandy-1.1.0b0.tar.gz.

File metadata

  • Download URL: mipcandy-1.1.0b0.tar.gz
  • Upload date:
  • Size: 34.2 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.0b0.tar.gz
Algorithm Hash digest
SHA256 46f4eef21567f1e050a1c1803ed2053768e0d9013f68f352e72a3d7fac8573cd
MD5 1ccb28c3fb9a6eb4af3289231ff2fa48
BLAKE2b-256 1efb9097b32532d9f3c30bc2b1ccd56c5bb46a640890f569fda0809651972cef

See more details on using hashes here.

Provenance

The following attestation bundles were made for mipcandy-1.1.0b0.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.0b0-py3-none-any.whl.

File metadata

  • Download URL: mipcandy-1.1.0b0-py3-none-any.whl
  • Upload date:
  • Size: 47.0 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.0b0-py3-none-any.whl
Algorithm Hash digest
SHA256 9f84000bca4ee9d2b00258d59abf85d95e5c689be446d8ebd3d8aab5b3b7f044
MD5 90d075401ecedd5eda0e946cd0fb44a1
BLAKE2b-256 252fa22cb074cd4d42681c869bd8649b453152768fbf528a4ca528169ddf1743

See more details on using hashes here.

Provenance

The following attestation bundles were made for mipcandy-1.1.0b0-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