Model or dataset
TorchIO-project/torchio avatar
TorchIO-project/torchio

TorchIO ships 2.0.0a2 and calls itself Production/Stable

Medical imaging processing for AI applications.

2,459 stars297 forksPythonApache-2.0

At a glance

What is it?
A Python package for reading, augmenting and patch-sampling 3D medical images in PyTorch, whose own metadata contains a few disagreements worth reading before you pin a version.
Who is it for?
TorchIO fits a PyTorch pipeline that reads, augments and patch-samples 3D medical volumes and wants those steps typed and reproducible rather than hand written per dataset. It does not fit a project that needs a stable release line today, because the version in the project file is an alpha while the classifier beside it claims Production/Stable, and the two 2.0 tags were published 71 seconds apart on the same evening.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 10 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 23, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • TorchIO-project/torchio2,459 ★ · +17
Star history
Repository2026-09-112026-11-23
TorchIO-project/torchio2.4k2.5k

17 Stars in the last 73 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

Two 2.0 tags 71 seconds apart, and a classifier that disagrees with both

The release list has three entries. v1.2.1 was published on 2026-06-02. Then two alphas of the next line arrived on the same evening of 2026-07-20: v2.0.0a1 at 20:30:02 and v2.0.0a2 at 20:31:21, 71 seconds apart. Both carry their tag as their release name, with no notes attached in the listing.

The tree agrees with the newer of the two. The version field in pyproject.toml reads 2.0.0a2, so the working copy is an alpha of the 2.0 line rather than the 1.2.1 that people pinning a version would more likely have in a working environment.

What that file also carries is a classifier reading Development Status :: 5 - Production/Stable. An alpha version number and a Production/Stable status sit in the same block of metadata, and neither line qualifies the other. For a library whose main cost is being wrong about spatial transforms on clinical images, that mismatch is worth resolving in your own pinning policy rather than inheriting, because pip will install the alpha happily and the classifier will say nothing about it on the index page.

The rest of the classifier list is more conservative than the version: Operating System :: OS Independent, Intended Audience :: Science/Research, and Python only, with 3.10 through 3.14 enumerated.

Fourteen dependencies, and only three of them carry a lower bound

The dependency list mixes two policies. torch-interpol>=0.3.0, typing_extensions>=4.15.0 and tyro>=1.0.15 are pinned from below, which means the project expects specific minimum behaviour from its own interpolation helper, from the typing backport and from the command line argument library. Everything else is a bare name: torch, numpy, nibabel, simpleitk, einops, jaxtyping, loguru, rich, humanize, platformdirs, and fsspec with its http extra.

That split has consequences for medical imaging specifically. simpleitk and nibabel are the two libraries that actually read volumes, and the SimpleITK version decides which file formats and metadata fields resolve, while the torch version decides the dtype and device behaviour that transforms run under. Neither is bounded, so two installs of the same TorchIO version can sit on different readers.

The http extra on fsspec is the other thing to notice, since it means the package's file layer can be pointed at remote locations rather than a local path, and nothing in the dependency list says which schemes that covers. jaxtyping is a runtime dependency rather than a development one, which pairs with the Typing :: Typed classifier: the shape checking is part of the installed package, not something that disappears after install.

Two homepages, and a root with six files that configure tooling

The project advertises two addresses. The repository's homepage field points at docs.torchio.org, while the project.urls table in pyproject.toml lists Homepage as https://torchio.org and Documentation as https://docs.torchio.org, alongside Source and Issue tracker. The documentation site and the marketing site are therefore different hosts, and only one of them is where the reference material lives.

The root of the repository carries the configuration for all of that. There is a CNAME file and a zensical.toml next to docs/, which is the site generator configuration, and a .python-version file plus a mise.toml and a .mise directory, which is a second and third way of pinning the interpreter. Add .pre-commit-config.yaml, .scrutinizer.yml and tox.ini and six files at the top level are about tooling rather than code.

One entry does not fit the pattern. print_system.py sits at the repository root as a loose script among the configuration, while the package itself lives under src/, and neither the README nor the project metadata says what that script prints or who runs it.

The README is an index of anchors into a single transforms page

The augmentation table in the README is nine rows of links, and every link points into one documentation page, docs.torchio.org/transforms/augmentation.html, with a different anchor each time: randomblur, randomflip, randomnoise, randomaffine, randomelasticdeformation, randombiasfield, randommotion, randomspike and randomghosting. The README contributes the names and the anchors; the behaviour is on the linked page.

Split by what they simulate, the list divides cleanly. Four are ordinary computer vision operations: random blur, random flip, random noise, and random affine transformation, joined by random elastic deformation. Five are imaging artifacts, and the package says so plainly, naming simulation of intensity artifacts due to MRI magnetic field inhomogeneity and k-space motion artifacts as the domain-specific cases. A random bias field artifact, a random motion artifact, a random spike artifact and a random ghosting artifact belong to that second group.

So the naming tells you which half a transform belongs to before you open the documentation, and the artifact half is the reason a general purpose augmentation library is not what this is. Reading, preprocessing, sampling, augmenting and writing 3D medical images is the stated scope, and intensity and spatial transforms are what fill it.

Patch sampling gets its own block, because the queue is where the memory goes

Two documentation areas are linked directly from the README rather than through the transforms table. The first is patch-based training: a link to the patches index page, and a separate link whose anchor is queue, pointing into the patch training page. That queue is the one piece of machinery the README singles out, and it is singled out with a link rather than an explanation.

Patch-based training is the step where a 3D volume stops being loaded whole. Once volumes are sampled in patches, the memory cost of a batch is set by the patch shape and the batch size rather than by the size of the volume, which is why a queue belongs next to a sampler in this kind of pipeline. The README leaves the details, including what the queue holds and how it is filled, on the documentation side.

The other direct link is the tutorials page, a single README in the repository under tutorials/, which the package badges point at as the entry for worked examples. The remaining badges are for distribution and for the checks around the code: PyPI and conda-forge for installation, two CI workflows for tests and for docs, and coverage reported through Codecov.

NiftyNet is named as the ancestor, and the citation is from 2021

The one lineage statement in the README is short: the package has been greatly inspired by NiftyNet, which is linked as no longer being worked on, with the link pointing at a commit in that repository rather than at its homepage. The comparison being made is about domain, since NiftyNet was also a medical imaging library, and the credit is given in a sentence rather than a section.

The Credits section asks two things. Click Star if you like the repository, and cite the paper if you use the package in research. The citation is specific: F. Pérez-García, R. Sparks and S. Ourselin, TorchIO: a Python library for efficient loading, preprocessing, augmentation and patch-based sampling of medical images in deep learning, in Computer Methods and Programs in Biomedicine, June 2021, page 106236, with an ISSN and a DOI. The paper predates the 2.0 alphas by five years, and the citation carries no version number, so it identifies the library rather than the code you have installed.

The repository root carries matching citation machinery in the form of CITATION.cff and a .zenodo.json, so the archive metadata for a DOI is versioned alongside the code even though the requested citation is not. The README closes this section with a fenced block introduced as a BibTeX entry, and the block itself is not shown beyond its opening line.

Linting is split between Ruff, Scrutinizer and pre-commit

The badge table in the README separates code quality from continuous integration. Continuous integration points at two workflows, tests.yml and docs.yml, plus Codecov for coverage. Code quality points at two external services, the Ruff project at astral and Scrutinizer CI with its query pinned to branch=main.

So a change is linted in at least three places, with no single configuration file for it in the tree: Ruff is wired through .pre-commit-config.yaml for local commits, Scrutinizer runs against main as a hosted service, and tox.ini sits at the root as a fourth entry point for running things in isolation. Which one is authoritative is not stated, and the README does not name a style guide or a line length, so the configuration has to be read from those files.

The rest of the root is governance rather than build: CODE_OF_CONDUCT.md, CONTRIBUTING.md, an all-contributorsrc for the contributor list, and an Apache-2.0 LICENSE that matches the license field in pyproject.toml. The description in that same file is a one-liner, medical image preprocessing, augmentation, and patch-based training, which is a narrower sentence than the README's own account of reading, preprocessing, sampling, augmenting and writing volumes.

Editorial conclusion

TorchIO fits a PyTorch pipeline that reads, augments and patch-samples 3D medical volumes and wants those steps typed and reproducible rather than hand written per dataset. It does not fit a project that needs a stable release line today, because the version in the project file is an alpha while the classifier beside it claims Production/Stable, and the two 2.0 tags were published 71 seconds apart on the same evening. Before depending on it, check three things: which Python you are on, since the floor is 3.10 and the classifier list reaches 3.14; whether your SimpleITK and nibabel versions sit well with unpinned torch and numpy in the dependency list; and whether the transforms you need are the domain-specific ones, since the artifact transforms simulate MRI field inhomogeneity and k-space motion rather than being generic image effects. Pin an exact version, and treat the citation request in the README as pointing at a 2021 paper rather than at the code you are running.

Frequently asked questions

What does TorchIO actually do?

It is a Python package of tools to efficiently read, preprocess, sample, augment and write 3D medical images in deep learning applications written in PyTorch, providing intensity and spatial transforms. Alongside typical computer vision operations it includes domain-specific transforms such as simulation of intensity artifacts from MRI magnetic field inhomogeneity and k-space motion artifacts.

What is the relationship between TorchIO and NiftyNet?

The README says the package has been greatly inspired by NiftyNet, and links that project as no longer being worked on by pointing at one of its commits. TorchIO is a separate project under the TorchIO-project organisation, distributed through PyPI and conda-forge, and it adds patch-based training on top of the loading and augmentation work.

Which Python versions and package versions does TorchIO support?

pyproject.toml sets requires-python to >=3.10, and the classifiers enumerate 3.10, 3.11, 3.12, 3.13 and 3.14. The version in that file is 2.0.0a2, an alpha, while the Development Status classifier beside it reads 5, Production/Stable.

What has to be installed for TorchIO?

Fourteen dependencies, including torch, numpy, nibabel and simpleitk, with lower bounds only on torch-interpol>=0.3.0, typing_extensions>=4.15.0 and tyro>=1.0.15. fsspec is required with its http extra, and the package is distributed on both PyPI and conda-forge.

Official sources

  1. License: Apache-2.0
  2. Project website
  3. README
  4. Releases
  5. TorchIO-project/torchio on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/torchio-project-torchio.svg)](https://hysenlabs.com/projects/torchio-project-torchio)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/torchio-project-torchio.svg)](https://hysenlabs.com/projects/torchio-project-torchio)

Was this useful?