Skip to main content

PyMIC: A Pytorch-Based Toolkit for Medical Image Computing

PyMIC is a pytorch-based toolkit for medical image computing with annotation-efficient deep learning. Despite that pytorch is a fantastic platform for deep learning, using it for medical image computing is not straightforward as medical images are often with high dimension and large volume, multiple modalities and difficulies in annotating. This toolkit is developed to facilitate medical image computing researchers so that training and testing deep learning models become easier. It is very friendly to researchers who are new to this area. Even without writing any code, you can use PyMIC commands to train and test a model by simply editing configuration files. PyMIC is developed to support learning with imperfect labels, including semi-supervised, self-supervised, and weakly supervised learning, and learning with noisy annotations.

Currently PyMIC supports 2D/3D medical image classification and segmentation, and it is still under development. If you use this toolkit, please cite the following paper:

BibTeX entry:

@article{Wang2022pymic,
author = {Guotai Wang and Xiangde Luo and Ran Gu and Shuojue Yang and Yijie Qu and Shuwei Zhai and Qianfei Zhao and Kang Li and Shaoting Zhang},
title = {{PyMIC: A deep learning toolkit for annotation-efficient medical image segmentation}},
year = {2023},
url = {https://doi.org/10.1016/j.cmpb.2023.107398},
journal = {Computer Methods and Programs in Biomedicine},
volume = {231},
pages = {107398},
}

News

  • 2025/08 PyMIC has contained the implementation of DMSPS, a state-of-the-art weakly supervised segmentation method by learning from scribble annotations.
  • 2025/05 Several self-supervised learning methods have been provided in PyMIC, including VolF, VoCo and Vox2Vec.
  • 2025/01 Novel architectures are available now, such as UMamba, VMUNet, SwinUNet, TransUNet and UNETR++.

Features

PyMIC provides flixible modules for medical image computing tasks including classification and segmentation. It currently provides the following functions:

  • Support for annotation-efficient image segmentation, especially for semi-supervised, self-supervised, self-supervised, weakly-supervised and noisy-label learning.
  • User friendly: For beginners, you only need to edit the configuration files for model training and inference, without writing code. For advanced users, you can customize different modules (networks, loss functions, training pipeline, etc) and easily integrate them into PyMIC.
  • Easy-to-use I/O interface to read and write different 2D and 3D images.
  • Various data pre-processing/transformation methods before sending a tensor into a network.
  • Implementation of typical neural networks for medical image segmentation.
  • Re-useable training and testing pipeline that can be transferred to different tasks.
  • Evaluation metrics for quantitative evaluation of your methods.

Usage

Requirement

  • Pytorch version >=1.13.1
  • TensorboardX to visualize training performance
  • Some common python packages such as Numpy, Pandas, SimpleITK
  • causal-conv1d>=1.5.0 and mamba-ssm>=2.2.4 are required if you want to use Mamba in PyMIC.
  • See requirements.txt for details.

Installation

Run the following command to install the latest released version of PyMIC:

pip install PYMIC

To install a specific version of PYMIC such as 0.5.4, run:

pip install PYMIC==0.5.4

Alternatively, you can download the source code for the latest version. Run the following command to compile and install:

python setup.py install

How to start

Projects based on PyMIC

Using PyMIC, it becomes easy to develop deep learning models for different projects, such as the following:

1, MyoPS Winner of the MICCAI 2020 myocardial pathology segmentation (MyoPS) Challenge.

2, COPLE-Net (TMI 2020), COVID-19 Pneumonia Segmentation from CT images.

3, Head-Neck-GTV (NeuroComputing 2020) Nasopharyngeal Carcinoma (NPC) GTV segmentation from Head and Neck CT images.

4, UGIR (MICCAI 2020) Uncertainty-guided interactive refinement for medical image segmentation.

5, DMSPS (MedIA 2024) Weakly supervised segmentation by learning from scribbles.

Metadata

Release files for PYMIC 0.6.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PYMIC 0.6.2
File Size Uploaded
pymic-0.6.2.tar.gz 234.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for PYMIC 0.6.2
File Interpreter ABI Platform
pymic-0.6.2-py3-none-any.whl Python 3 none any Details

Total release size: 582.3 kB

Release files / pymic-0.6.2.tar.gz

Download URL pymic-0.6.2.tar.gz
Size 234.8 kB
Tags Source
SHA-256 checksum
How to use checksums
1f7dfd43c65824ebe04e0bcb3bcf2c3a27ef2a6b5cd3afac71b55a934b1ef290
BLAKE2b-256 checksum
How to use checksums
51571ce8b1bec7906dd1c99f02cc05430147526cdacfb4dd3612466f1936c9e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.16

Release files / pymic-0.6.2-py3-none-any.whl

Download URL pymic-0.6.2-py3-none-any.whl
Size 347.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
884cae1910a418281a80248243efa1c461300f599013a3bd69cb36f047530ce5
BLAKE2b-256 checksum
How to use checksums
2189775b9c2abc3b768278a5d01debffbd2f0b5fb5d95715c8f3c0fad7964e0a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.16

Release history Release notifications | RSS feed

This release

0.6.2 This release

2 release files

0.6.1

2 release files

0.5.4

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

1 release file

0.2.2

3 release files

0.2.1

1 release file

0.2

3 release files

0.1

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