TorchIO
PyTorch library for loading, preprocessing, augmenting, and patch-sampling 3D medical images (MRI/CT) for deep learning.
TorchIO
TorchIO is a Python library for efficient loading, preprocessing, augmentation, and patch-based sampling of 3D medical images such as MRI and CT volumes, designed to integrate cleanly with PyTorch deep-learning workflows. It provides medical-imaging-specific transforms that model realistic scanner artifacts, which general computer-vision augmentation libraries lack.
Key features
- Medical-specific augmentations: random motion, ghosting, bias field, spikes, and anisotropy artifacts
- Standard spatial and intensity transforms with reproducible, invertible pipelines
- Queue-based patch sampling for training on large volumes with limited memory
- GridSampler and aggregator for dense patch-wise inference
- SimpleITK and NiBabel I/O supporting NIfTI, DICOM, and more
- Native PyTorch Dataset/DataLoader integration
Wrap your volumes in a Subject, compose a transforms pipeline, and feed patches through a Queue into a standard DataLoader. Widely adopted for segmentation and classification of neuroimaging and radiology data, and a strong complement to frameworks like MONAI and nnU-Net.
Curated mirror of the open-source TorchIO (Apache-2.0). Get it from the source.