Papers › TorchIO: A Python library for efficient loading, preprocessing, augmentation and...

TorchIO: A Python library for efficient loading, preprocessing, augmentation and patch-based sampling of medical images in deep learning

9 Mar 2020arXiv:2003.04696archive 2025-07-28

Fernando Pérez-García, Rachel Sparks, Sébastien Ourselin

Processing of medical images such as MRI or CT presents unique challenges compared to RGB images typically used in computer vision. These include a lack of labels for large datasets, high computational costs, and metadata to describe the physical properties of voxels. Data augmentation is used to artificially increase the size of the training datasets. Training with image patches decreases the need for computational power. Spatial metadata needs to be carefully taken into account in order to ensure a correct alignment of volumes. We present TorchIO, an open-source Python library to enable efficient loading, preprocessing, augmentation and patch-based sampling of medical images for deep learning. TorchIO follows the style of PyTorch and integrates standard medical image processing libraries to efficiently process images during training of neural networks. TorchIO transforms can be composed, reproduced, traced and extended. We provide multiple generic preprocessing and augmentation operations as well as simulation of MRI-specific artifacts. Source code, comprehensive tutorials and extensive documentation for TorchIO can be found at https://torchio.rtfd.io/. The package can be installed from the Python Package Index running 'pip install torchio'. It includes a command-line interface which allows users to apply transforms to image files without using Python. Additionally, we provide a graphical interface within a TorchIO extension in 3D Slicer to visualize the effects of transforms. TorchIO was developed to help researchers standardize medical image processing pipelines and allow them to focus on the deep learning experiments. It encourages open science, as it supports reproducibility and is version controlled so that the software can be cited precisely. Due to its modularity, the library is compatible with other frameworks for deep learning with medical images.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2003.04696")

Code

Syntology Ran 0 of 6 code samples harvested from 2 repositories linked to this paper; 6 have no recorded run.

By repository: community (archive-listed): 6 samples from 2 repositories, 0 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

fepegar/torchio officialmentioned in papermentioned on GitHubpytorchApache-2.0 report
DiamondLightSource/gas-hydrate-segmentation-unets mentioned on GitHubpytorchApache-2.0 report
fepegar/SlicerTorchIO mentioned on GitHubpytorchNOASSERTION report
zl2860/InterpretableDL mentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

6 samples harvested; 0 ran; 0 honoured the contract we drafted; 6 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

6unverified

Licence: 0 of the 6 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 2 repositories linked to this paper, official or community; each sample names its own and says which. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

CheckExt DiamondLightSource/gas-hydrate-segmentation-unets/unet_methods/unet_2d/utilities/cmdline.py community (archive-listed) unverified Apache-2.0 (permissive) · 60b0812fdd32621c · report
numpy_from_hdf5 DiamondLightSource/gas-hydrate-segmentation-unets/unet_methods/unet_3d/train_3d_unet.py community (archive-listed) unverified Apache-2.0 (permissive) · f4b600ad05fe339a · report
partitioning MitraDP/Pancreas-CT-image-and-volumetric-segmentation/dataset.py community (archive-listed) unverified MIT (permissive) · 3933907a7e1c3e37 · report
patch_creator MitraDP/Pancreas-CT-image-and-volumetric-segmentation/volume_patch_composer.py community (archive-listed) unverified MIT (permissive) · 27d84b3c44f94eef · report
tensor_from_hdf5 DiamondLightSource/gas-hydrate-segmentation-unets/unet_methods/unet_3d/predict_3d_unet.py community (archive-listed) unverified Apache-2.0 (permissive) · fba4dbf1f3885826 · report
volume MitraDP/Pancreas-CT-image-and-volumetric-segmentation/inference.py community (archive-listed) unverified MIT (permissive) · 7c421199d69ae59b · report

Tasks

Data Augmentation

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections