torchio
Tools for medical image processing with PyTorch
Decision gist · record as of 2026-08-14
Yes. TorchIO is actively maintained, permissively licensed, and has low install friction. It fills a genuine gap for medical imaging practitioners using PyTorch by providing domain-specific transforms and efficient 3D I/O that would otherwise require custom code. The library is well-established with strong community adoption (2431 stars) and no known security vulnerabilities. Install it if you're building medical imaging models with PyTorch.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires torch and nibabel to be installed; torch installation can be system-specific depending on GPU support.
- Low friction installation with a pure-Python wheel.
- Active maintenance with a recent release and 2431 GitHub stars.
License · maintenance · safety
Apache-2.0 (permissive) — Apache-2.0 permissive license allows use in commercial and proprietary projects with minimal restrictions, requiring only attribution and a copy of the license.
last release 2026-06-02 (73 days) · last repo commit 2026-08-01 · 2,431 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 91,096 downloads/mo, #13,541 on PyPI
Alternatives
Verify before relying
pip install torchio
import torchio as tio
image = tio.ScalarImage('path/to/image.nii.gz')
transform = tio.Compose([
tio.RandomAffine(),
tio.RandomFlip()
])
transformed = transform(image)- Whether patch-based training queue integrates seamlessly with standard PyTorch DataLoader workflows.
- Performance characteristics when processing very large volumetric datasets or working with limited GPU memory.
- Actual monthly download volume and user base size beyond the GitHub star count.
What it is and what it does
TorchIO is a specialized library for working with 3D medical images in PyTorch-based deep learning pipelines. It handles the full workflow from loading medical image formats (via nibabel) through preprocessing, augmentation, and sampling patches for training. The library includes both standard transforms—affine transformations, flips, noise injection—and domain-specific operations that simulate real MRI artifacts like magnetic field inhomogeneity effects and k-space motion artifacts, making it valuable for training models on realistic medical imaging data.
The package is designed for efficiency in patch-based training, where 3D volumes are sampled into smaller regions for memory-constrained training. It integrates with PyTorch's ecosystem and provides a queue-based sampling mechanism for iterative training workflows. With 13 runtime dependencies including torch, scipy, nibabel, and rich, it brings together the tools needed for medical image I/O, numerical operations, and user-friendly progress reporting in a single coherent interface.
Use it for
- Train deep learning models on 3D MRI or CT scans with realistic medical image augmentation.
- Preprocess volumetric medical images for patch-based segmentation or classification tasks.
- Simulate MRI artifacts during training to improve model robustness to real acquisition imperfections.
- Load and normalize medical images in standard formats for PyTorch pipelines.
- Sample spatial patches from large 3D volumes for memory-efficient training on GPUs.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
TorchIO is actively maintained, permissively licensed, and has low install friction. It fills a genuine gap for medical imaging practitioners using PyTorch by providing domain-specific transforms and efficient 3D I/O that would otherwise require custom code. The library is well-established with strong community adoption (2431 stars) and no known security vulnerabilities. Install it if you're building medical imaging models with PyTorch.
Install
torchio on PyPI
Before you install
Low friction installation with a pure-Python wheel. Active maintenance with a recent release and 2431 GitHub stars. Depends on established libraries like torch, numpy, scipy, and nibabel for medical image I/O.
Requires torch and nibabel to be installed; torch installation can be system-specific depending on GPU support.
License in practice
Apache-2.0 permissive license allows use in commercial and proprietary projects with minimal restrictions, requiring only attribution and a copy of the license.
Quickstart
pip install torchio
import torchio as tio
image = tio.ScalarImage('path/to/image.nii.gz')
transform = tio.Compose([
tio.RandomAffine(),
tio.RandomFlip()
])
transformed = transform(image)
Verify before relying
- Whether patch-based training queue integrates seamlessly with standard PyTorch DataLoader workflows.
- Performance characteristics when processing very large volumetric datasets or working with limited GPU memory.
- Actual monthly download volume and user base size beyond the GitHub star count.
Package facts
| License | Apache-2.0 permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 13 packagesdeprecatedeinopshumanizejaxtypingnibabelnumpypackagingrichscipysimpleitktorchtqdmtyper |
| Maintenance | Actively maintained 73 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 91,096 / month, #13,541 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaEnvironment :: ConsoleIntended Audience :: Science/ResearchNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Scientific/EngineeringTopic :: Scientific/Engineering :: Artificial IntelligenceTopic :: Scientific/Engineering :: Image ProcessingTopic :: Scientific/Engineering :: Medical Science Apps.Typing :: Typed |
Evidence: torchio-1.2.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “3D medical image preprocessing pytorch”
- torchioTorchIO reads, preprocesses, augments, and samples 3D medical images…
- nnunetv2nnU-Net is a semantic segmentation framework that automatically…
- batchgeneratorsv2Reimplemented data augmentation transforms for deep learning,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Scientific/Engineering packages
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
pandas provides fast, flexible data structures (Series and DataFrame) for loading, cleaning, transforming, and analyzing labeled or relational data in Python.
scipy provides numerical algorithms for mathematics, science, and engineering—including optimization, integration, linear algebra, Fourier transforms, signal and image processing, and ODE solvers—built on numpy arrays.
scikit-learn provides a comprehensive Python library for supervised and unsupervised machine learning, including classification, regression, clustering, dimensionality reduction, and model evaluation tools built on NumPy and SciPy.
Install it if you need to train, evaluate, or deploy supervised or unsupervised learning models.
dill extends Python's pickle module to serialize and deserialize a much wider range of Python objects, including functions, lambdas, classes, and interpreter sessions, to byte streams for storage or network transmission.
Multiprocess is an enhanced fork of Python's standard multiprocessing library that uses dill for better serialization, allowing you to spawn processes with a threading-like API and share complex objects between them.
Install it if you use multiprocessing and encounter pickle serialization limits with lambdas or complex objects.
See also batchgeneratorsv2 · monai · batchgenerators · torchtext · TotalSegmentator · torchvision · torch-audiomentations · torchxrayvision · metaflow-torchrun