> *Tools like TorchIO are a symptom of the maturation of medical AI research using deep learning techniques*.
Jack Clark, Policy Director
at [OpenAI](https://openai.com/), Co-Founder and Head of Policy of Anthropic ([link](https://jack-clark.net/2020/03/17/)).
---
Package
CI
Code
Tutorials
Community
---
---
Original
Random blur
Random flip
Random noise
Random affine transformation
Random elastic transformation
Random bias field artifact
Random motion artifact
Random spike artifact
Random ghosting artifact
---
([Queue](https://docs.torchio.org/patches/patch_training.html#queue)
for [patch-based training](https://docs.torchio.org/patches/index.html))
---
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](https://pytorch.org/),
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](https://mriquestions.com/why-homogeneity.html)
or [k-space motion artifacts](http://proceedings.mlr.press/v102/shaw19a.html).
This package has been greatly inspired by NiftyNet,
[which is not actively maintained anymore](https://github.com/NifTK/NiftyNet/commit/935bf4334cd00fa9f9d50f6a95ddcbfdde4031e0).
## Credits
If you like this repository, please click on Star!
If you use this package for your research, please cite our 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.](https://doi.org/10.1016/j.cmpb.2021.106236)
BibTeX entry:
```bibtex
@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},
}
```
This project was originally supported by the following institutions:
- [Engineering and Physical Sciences Research Council (EPSRC) & UK Research and Innovation (UKRI)](https://epsrc.ukri.org/)
- [EPSRC Centre for Doctoral Training in Intelligent, Integrated Imaging In Healthcare (i4health)](https://www.ucl.ac.uk/intelligent-imaging-healthcare/) (University College London)
- [Wellcome / EPSRC Centre for Interventional and Surgical Sciences (WEISS)](https://www.ucl.ac.uk/interventional-surgical-sciences/) (University College London)
- [School of Biomedical Engineering & Imaging Sciences (BMEIS)](https://www.kcl.ac.uk/bmeis) (King's College London)
## Getting started
See [Getting started](https://docs.torchio.org/quickstart.html) for
[installation](https://docs.torchio.org/quickstart.html#installation)
instructions
and a [Hello, World!](https://docs.torchio.org/quickstart.html#hello-world)
example.
Longer usage examples can be found in the
[tutorials](https://github.com/TorchIO-project/torchio/blob/main/tutorials/README.md).
Read the [documentation](https://docs.torchio.org/) for more information.
Please
[create an issue](https://github.com/TorchIO-project/torchio/issues/new/choose)
if you think something is missing.
## Contributors
Thanks goes to all these people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
Fernando Pérez-García
valabregue
GFabien
G.Reguig
Niels Schurink
Ibrahim Hadzic
ReubenDo
Julian Klug
David Völgyes