Skip to main content

TorchIO logo

Tools like TorchIO are a symptom of the maturation of medical AI research using deep learning techniques.

Jack Clark, Policy Director at OpenAI (link).


Package PyPI downloads PyPI version Conda version Contributors
CI Build status Documentation status Coverage status
Code Code quality Code maintainability pre-commit
Notebooks Google Colab
Social Slack Slack

Progressive artifacts

Augmentation


Original Random blur
Original Random blur
Random flip Random noise
Random flip Random noise
Random affine transformation Random elastic transformation
Random affine transformation Random elastic transformation
Random bias field artifact Random motion artifact
Random bias field artifact Random motion artifact
Random spike artifact Random ghosting artifact
Random spike artifact Random ghosting artifact

Queue

(Queue for patch-based training)


TorchIO is a Python package containing a set of tools to efficiently read, preprocess, sample, augment, and write 3D medical images in deep learning applications written in PyTorch, including intensity and spatial transforms for data augmentation and preprocessing. Transforms include typical computer vision operations such as random affine transformations and also domain-specific ones such as simulation of intensity artifacts due to MRI magnetic field inhomogeneity or k-space motion artifacts.

This package has been greatly inspired by NiftyNet, which is not actively maintained anymore.

Credits

If you like this repository, please click on Star!

If you use this package for your research, please cite the paper:

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. Computer Methods and Programs in Biomedicine (June 2021), p. 106236. ISSN: 0169-2607.doi:10.1016/j.cmpb.2021.106236.

BibTeX entry:

@article{perez-garcia_torchio_2021,
    title = {TorchIO: a Python library for efficient loading, preprocessing, augmentation and patch-based sampling of medical images in deep learning},
    journal = {Computer Methods and Programs in Biomedicine},
    pages = {106236},
    year = {2021},
    issn = {0169-2607},
    doi = {https://doi.org/10.1016/j.cmpb.2021.106236},
    url = {https://www.sciencedirect.com/science/article/pii/S0169260721003102},
    author = {P{\'e}rez-Garc{\'i}a, Fernando and Sparks, Rachel and Ourselin, S{\'e}bastien},
    keywords = {Medical image computing, Deep learning, Data augmentation, Preprocessing},
}

This project is supported by the following institutions:

Getting started

See Getting started for installation instructions and a Hello, World! example.

Longer usage examples can be found in the notebooks.

All the documentation is hosted on Read the Docs.

Please open a new issue if you think something is missing.

Contributors

Thanks goes to all these people (emoji key):


Fernando Pérez-García

💻 📖

valabregue

🤔 👀 💻

GFabien

💻 👀 🤔

G.Reguig

💻

Niels Schurink

💻

Ibrahim Hadzic

🐛

ReubenDo

🤔

Julian Klug

🤔

David Völgyes

🤔 💻

Jean-Christophe Fillion-Robin

📖

Suraj Pai

🤔

Ben Darwin

🤔

Oeslle Lucena

🐛

Soumick Chatterjee

💻

neuronflow

📖

Jan Witowski

📖

Derk Mus

📖 💻

Christian Herz

🐛

Cory Efird

💻

Esteban Vaca C.

🐛

Ray Phan

🐛

Akis Linardos

🐛 💻

Nina Montana-Brown

📖

fabien-brulport

🐛

malteekj

🐛

Andres Diaz-Pinto

🐛

Sarthak Pati

📦

GabriellaKamlish

🐛

Tyler Spears

🐛

DaGuT

📖

Xiangyu Zhao

🐛

siahuat0727

📖 🐛

Svdvoort

💻

Albans98

💻

Matthew T. Warkentin

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

History

0.18.0 (29-11-2020)

  • Add FPG dataset
  • Optimize cropping in samplers
  • Optimize implementation of UniformSampler and WeightedSampler
  • Fix non integer labels in Colin 27 version 2008 (#223)
  • Add RandomAnisotropy transform
  • Add RandomGamma transform
  • Add ScalarImage and LabelMap classes
  • Add RandomLabelsToImage transform
  • Add support for more input types in Transform
  • Add support for 4D images
  • Add ICBM dataset
  • Add support to specify axes as anatomical labels
  • Add SpatialTransform and IntensityTransform
  • Replace ImagesDataset with SubjectsDataset
  • Add support to pass multiple paths to Image
  • Refactor reproducibility features
  • Add deterministic versions of all random transforms
  • Add support to invert transforms
  • Add support for SimpleITK > 1
  • Add pre-commit to help contributions and improve coda quality
  • Add DICOM data for testing
  • Add some visualization support (Subject.plot, Image.plot)
  • Add support to pass parameters per axis, e.g. for RandomAffine (#346)
  • Remove deprecated transforms Resample and CenterCropOrPad

0.17.0 (23-06-2020)

  • Add transforms history to Subject attributes to improve traceability
  • Add support to use an initial transformation in Resample
  • Add support to use an image file as target in Resample
  • Add mean argument to RandomNoise
  • Add tensor support for transforms
  • Add support to use strings as interpolation argument
  • Add support for 2D images
  • Add attribute access to Subject and Image
  • Add MNI and 3D Slicer datasets
  • Add intensity argument to RandomGhosting
  • Add translation argument to RandomAffine
  • Add shape, spacing and orientation attributes to Image and Subject
  • Refactor samplers
  • Refactor inference classes
  • Add 3D Slicer extension
  • Add ITK-SNAP datasets
  • Add support to take NumPy arrays as transforms input
  • Optimize cropping using PyTorch
  • Optimizing transforms by reducing number of tensor copying
  • Improve representation (repr()) of Image
  • Use lazy loading in Image

0.16.0 (21-04-2020)

  • Add advanced padding options for RandomAffine
  • Add reference space options in Resample
  • Add probability argument to all transforms
  • Add OneOf and Compose transforms to improve composability

0.15.0 (07-04-2020)

  • Refactor RandomElasticDeformation transform
  • Make Subject inherit from dict

0.14.0 (31-03-2020)

  • Add datasets module
  • Add support for DICOM files
  • Add documentation
  • Add CropOrPad transform

0.13.0 (24-02-2020)

  • Add Subject class
  • Add random blur transform
  • Add lambda transform
  • Add random patches swapping transform
  • Add MRI k-space ghosting artefact augmentation

0.12.0 (21-01-2020)

  • Add ToCanonical transform
  • Add CenterCropOrPad transform

0.11.0 (15-01-2020)

  • Add Resample transform

0.10.0 (15-01-2020)

  • Add Pad transform
  • Add Crop transform

0.9.0 (14-01-2020)

  • Add CLI tool to transform an image from file

0.8.0 (11-01-2020)

  • Add Image class

0.7.0 (02-01-2020)

  • Make transforms use PyTorch tensors consistently

0.6.0 (02-01-2020)

  • Add support for NRRD

0.5.0 (01-01-2020)

  • Add bias field transform

0.4.0 (29-12-2019)

  • Add MRI k-space motion artefact augmentation

0.3.0 (21-12-2019)

  • Add Rescale transform
  • Add support for multimodal data and missing modalities

0.2.0 (2019-12-06)

  • First release on PyPI.

Release files for torchio 0.18.47

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

Source distribution (sdist)

Source distribution for torchio 0.18.47
File Size Uploaded
torchio-0.18.47.tar.gz 37.9 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for torchio 0.18.47
File Interpreter ABI Platform
torchio-0.18.47-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 38.1 MB

Release files / torchio-0.18.47.tar.gz

Download URL torchio-0.18.47.tar.gz
Size 37.9 MB
Tags Source
SHA-256 checksum
How to use checksums
548b3b452131020134f16ecfc6c3a4f181d3886a5e832df632d7c5b5d594ab1f
BLAKE2b-256 checksum
How to use checksums
605f61a62afb4ec8db9aee38a81e04a84417966ea3d27c829f19b32052c05bbb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.7.1

Release files / torchio-0.18.47-py2.py3-none-any.whl

Download URL torchio-0.18.47-py2.py3-none-any.whl
Size 149.1 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
e4070898f980fb6e53f98ba2188e875a1d4b8046cd44a7513c7ff2e6bd5194e0
BLAKE2b-256 checksum
How to use checksums
6ec911d5a3245f641e8873e08ebae9b6fe051d8aaf78b03c182b96873f6d0c61
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.7.1

Release history Release notifications | RSS feed

1.2.1

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.23.1

2 release files

0.23.0

2 release files

0.21.3

2 release files

0.21.2

2 release files

0.21.1

2 release files

0.21.0

2 release files

0.20.8

2 release files

0.20.7

2 release files

0.20.6

2 release files

0.20.5

2 release files

0.20.4

2 release files

0.20.2

2 release files

0.20.0

2 release files

0.19.9

2 release files

0.19.8

2 release files

0.19.7

2 release files

0.19.6

2 release files

0.19.5

2 release files

0.19.4

2 release files

0.19.3

2 release files

0.19.0

2 release files

This release

0.18.47 This release

2 release files

0.18.41

1 release file

0.18.9

2 release files

0.18.8

2 release files

0.18.7

2 release files

0.18.6

2 release files

0.18.4

2 release files

0.18.3

2 release files

0.18.2

2 release files

0.18.0

2 release files

0.17.4

2 release files

0.17.2

2 release files

0.17.1

2 release files

0.17.0

2 release files

0.16.9

2 release files

0.16.8

2 release files

0.16.4

2 release files

0.16.3

2 release files

0.16.2

2 release files

0.16.1

2 release files

0.16.0

2 release files

0.14.0

2 release files

0.13.6

2 release files

0.13.5

2 release files

0.13.4

2 release files

0.13.2

2 release files

0.13.1

2 release files

0.13.0

2 release files

0.12.9

2 release files

0.12.8

2 release files

0.12.7

2 release files

0.12.6

2 release files

0.12.5

2 release files

0.12.4

2 release files

0.12.3

2 release files

0.12.2

2 release files

0.12.1

2 release files

0.12.0

2 release files

0.11.6

2 release files

0.11.5

2 release files

0.11.4

2 release files

0.11.3

2 release files

0.11.2

2 release files

0.11.0

2 release files

0.10.0

2 release files

0.9.0

2 release files

0.8.3

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.8

2 release files

0.7.7

2 release files

0.7.6

2 release files

0.7.5

2 release files

0.7.4

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7.0

1 release file

0.6.0

1 release file

0.5.0

1 release file

0.4.0

1 release file

0.3.0

1 release file

0.1.0

1 release file

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