No retraction, correction or concern found when last checked on Nov 1, 2026.
TorchIO: A Python library for efficient loading, preprocessing, augmentation and patch-based sampling of medical images in deep learning
Fernando Pérez-García, Rachel Sparks, Sébastien Ourselin
Computer Methods and Programs in Biomedicine · 2021 · CC BY-NC-SA
doi:10.1016/j.cmpb.2021.106236
Abstract
Background and objective. Processing of medical images such as MRI or CT presents different challenges compared to RGB images typically used in computer vision. These include a lack of labels for large datasets, high computational costs, and the need of metadata to describe the physical properties of voxels. Data augmentation is used to artificially increase the size of the training datasets. Training with image subvolumes or patches decreases the need for computational power. Spatial metadata needs to be carefully taken into account in order to ensure a correct alignment and orientation of volumes.
Methods. 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 easily composed, reproduced, traced and extended. Most transforms can be inverted, making the library suitable for test-time augmentation and estimation of aleatoric uncertainty in the context of segmentation. We provide multiple generic preprocessing and augmentation operations as well as simulation of MRI-specific artifacts.
Results. Source code, comprehensive tutorials and extensive documentation for TorchIO can be found at http://torchio.rtfd.io/. The package can be installed from the Python Package Index (PyPI) 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 user interface within a TorchIO extension in 3D Slicer to visualize the effects of transforms.
Conclusion. TorchIO was developed to help researchers standardize medical image processing pipelines and allow them to focus on the deep learning experiments. It encourages good open-science practices, as it supports experiment 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.
References 61
- 1.
Çiçek O., Abdulkadir A., Lienkamp S.S., Brox T., Ronneberger O., Ourselin S., Joskowicz L., Sabuncu M.R., Unal G., Wells W. Medical Image Computing and Computer-Assisted Intervention MICCAI 2016. 2016;424-432.
Not in our library
- 2.
- 3.
Chen F., Taviani V., Malkiel I., Cheng J.Y., Tamir J.I., Shaikh J., Chang S.T., Hardy C.J., Pauly J.M., Vasanawala S.S. Variable-density single-shot fast spin-echo MRI with deep learning reconstruction by using variational networks. Radiology. 2018;289(2):366-373.
Not in our library10.1148/radiol.2018180445
- 4.
Shan S., Yan W., Guo X., Chang E.I.-C., Fan Y., Xu Y. Unsupervised end-to-end learning for deformable medical image registration. arXiv:1711.08608 [cs]. 2018.
Not in our library
- 5.
Abadi M., Barham P., Chen J., Chen Z., Davis A., Dean J., Devin M., Ghemawat S., Irving G., Isard M., Kudlur M., Levenberg J., Monga R., Moore S., Murray D.G., Steiner B., Tucker P., Vasudevan V., Warden P., Wicke M., Yu Y., Zheng X. Proceedings of the 12th USENIX conference on Operating Systems Design and Implementation. 2016;265-283.
Not in our library
- 6.
Pawlowski N., Ktena S.I., Lee M.C.H., Kainz B., Rueckert D., Glocker B., Rajchl M. DLTK: state of the art reference implementations for deep learning on medical images. arXiv:1711.06853 [cs]. 2017.
Not in our library
- 7.
- 8.
Paszke A., Gross S., Massa F., Lerer A., Bradbury J., Chanan G., Killeen T., Lin Z., Gimelshein N., Antiga L., Desmaison A., Kopf A., Yang E., DeVito Z., Raison M., Tejani A., Chilamkurthy S., Steiner B., Fang L., Bai J., Chintala S., Wallach H., Larochelle H., Beygelzimer A., Alch-Buc F.d., Fox E., Garnett R. Advances in Neural Information Processing Systems 32. 2019;8026-8037.
Not in our library
- 9.
H. He, The State of Machine Learning Frameworks in 2019, 2019, http://bit.ly/3cjpliJ.
Not in our library
- 10.
Buslaev A., Iglovikov V.I., Khvedchenya E., Parinov A., Druzhinin M., Kalinin A.A. Albumentations: Fast and Flexible Image Augmentations. Information. 2020;11(2):125.
Not in our library10.3390/info11020125
- 11.
Larobina M., Murino L. Medical image file formats. J. Digit. Imaging. 2014;27(2):200-206.
Not in our library10.1007/s10278-013-9657-9
- 12.
Cardoso M.J., Modat M., Wolz R., Melbourne A., Cash D., Rueckert D., Ourselin S. Geodesic information flows: spatially-variant graphs and their application to segmentation and fusion. IEEE Trans. Med. Imaging. 2015;34(9):1976-1988.
Not in our library10.1109/tmi.2015.2418298
- 13.
Fedorov A., Beichel R., Kalpathy-Cramer J., Finet J., Fillion-Robin J.-C., Pujol S., Bauer C., Jennings D., Fennessy F., Sonka M., Buatti J., Aylward S., Miller J.V., Pieper S., Kikinis R. 3D slicer as an image computing platform for the quantitative imaging network. Magn. Reson. Imaging. 2012;30(9):1323-1341.
Not in our library10.1016/j.mri.2012.05.001
- 14.
- 15.
M. Brett, C.J. Markiewicz, M. Hanke, M.-A. Ct, B. Cipollini, P. McCarthy, C.P. Cheng, Y.O. Halchenko, M. Cottaar, S. Ghosh, E. Larson, D. Wassermann, S. Gerhard, G.R. Lee, H.-T. Wang, E. Kastman, A. Rokem, C. Madison, F.C. Morency, B. Moloney, M. Goncalves, C. Riddell, C. Burns, J. Millman, A. Gramfort, J. Leppkangas, R. Markello, J.J. van den Bosch, R.D. Vincent, H. Braun, K. Subramaniam, D. Jarecka, K.J. Gorgolewski, P.R. Raamana, B.N. Nichols, E.M. Baker, S. Hayashi, B. Pinsard, C. Haselgrove, M. Hymers, O. Esteban, S. Koudoro, N.N. Oosterhof, B. Amirbekian, I. Nimmo-Smith, L. Nguyen, S. Reddigari, S. St-Jean, E. Panfilov, E. Garyfallidis, G. Varoquaux, J. Kaczmarzyk, J.H. Legarreta, K.S. Hahn, O.P. Hinds, B. Fauber, J.-B. Poline, J. Stutters, K. Jordan, M. Cieslak, M.E. Moreno, V. Haenel, Y. Schwartz, B.C. Darwin, B. Thirion, D. Papadopoulos Orfanos, F. Pérez-García, I. Solovey, I. Gonzalez, J. Palasubramaniam, J. Lecher, K. Leinweber, K. Raktivan, P. Fischer, P. Gervais, S. Gadde, T. Ballinger, T. Roos, V.R. Reddam, freec84, nipy/nibabel: 3.0.1, 2020, https://zenodo.org/record/3628482.XlyGkJP7S8o
Not in our library10.5281/zenodo.3628482
- 16.
A.B. Jung, K. Wada, J. Crall, S. Tanaka, J. Graving, C. Reinders, S. Yadav, J. Banerjee, G. Vecsei, A. Kraft, Z. Rui, J. Borovec, C. Vallentin, S. Zhydenko, K. Pfeiffer, B. Cook, I. Fernndez, F.-M. De Rainville, C.-H. Weng, A. Ayala-Acevedo, R. Meudec, M. Laporte, others, imgaug, 2020, https://github.com/aleju/imgaug.
Not in our library
- 17.
wiredfool, A. Clark, Hugo, A. Murray, A. Karpinsky, C. Gohlke, B. Crowell, D. Schmidt, A. Houghton, S. Johnson, S. Mani, J. Ware, D. Caro, S. Kossouho, E.W. Brown, A. Lee, M. Korobov, M. Grny, E.S. Santana, N. Pieuchot, O. Tonnhofer, M. Brown, B. Pierre, J.C. Abela, L.J. Solberg, F. Reyes, A. Buzanov, Y. Yu, eliempje, F. Tolf, Pillow: 3.1.0, 2016, https://zenodo.org/record/44297.Xlx04pP7S8o. doi:.
Not in our library10.5281/zenodo.44297
- 18.
Krizhevsky A., Sutskever I., Hinton G.E. Proceedings of the 25th International Conference on Neural Information Processing Systems - Volume 1. 2012;1097-1105.
Not in our library
- 19.
Chen T., Kornblith S., Norouzi M., Hinton G. International Conference on Machine Learning. 2020;1597-1607.
Not in our library
- 20.
Milletari F., Navab N., Ahmadi S.-A. 2016 Fourth International Conference on 3D Vision (3DV). 2016;565-571.
Not in our library10.1109/3dv.2016.79
- 21.
Ioffe S., Szegedy C. International Conference on Machine Learning. 2015;448-456.
Not in our library
- 22.
Lucena O., Souza R., Rittner L., Frayne R., Lotufo R. Convolutional neural networks for skull-stripping in brain MR imaging using silver standard masks. Artif. Intell. Med. 2019;98:48-58.
Not in our library10.1016/j.artmed.2019.06.008
- 23.
Li W., Wang G., Fidon L., Ourselin S., Cardoso M.J., Vercauteren T., Niethammer M., Styner M., Aylward S., Zhu H., Oguz I., Yap P.-T., Shen D. Information Processing in Medical Imaging. 2017;348-360.
Not in our library10.1007/978-3-319-59050-9_28
- 24.
- 25.
Deng J., Dong W., Socher R., Li L.-J., Li K., Fei-Fei L. 2009 IEEE Conference on Computer Vision and Pattern Recognition. 2009;248-255.
Not in our library10.1109/cvpr.2009.5206848
- 26.
Weiss K., Khoshgoftaar T.M., Wang D. A survey of transfer learning. J. Big Data. 2016;3(1):9.
Not in our library10.1186/s40537-016-0043-6
- 27.
Cheplygina V. Cats or CAT scans: transfer learning from natural or medical image source data sets? Curr. Opin. Biomed. Eng. 2019;9:21-27.
Not in our library10.1016/j.cobme.2018.12.005
- 28.
Raghu M., Zhang C., Kleinberg J., Bengio S., Wallach H., Larochelle H., Beygelzimer A., Alch-Buc F.d., Fox E., Garnett R. Advances in Neural Information Processing Systems. 2019;volume 32.
Not in our library
- 29.
Nyl L.G., Udupa J.K. On standardizing the MR image intensity scale. Magn. Reson. Med. 1999;42(6):1072-1081.
Not in our library10.1002/(sici)1522-2594(199912)42:6<1072::aid-mrm11>3.0.co;2-m
- 30.
van der Walt S., Colbert S.C., Varoquaux G. The NumPy array: a structure for efficient numerical computation. Comput. Sci. Eng. 2011;13(2):22-30.
Not in our library10.1109/mcse.2011.37
- 31.
Valindria V.V., Pawlowski N., Rajchl M., Lavdas I., Aboagye E.O., Rockall A.G., Rueckert D., Glocker B. 2018 IEEE Winter Conference on Applications of Computer Vision (WACV). 2018;547-556.
Not in our library10.1109/wacv.2018.00066
- 32.
C.S. Perone, cclauss, E. Saravia, P.L. Ballester, MohitTare, perone/medicaltorch: Release v0.2, 2018, https://zenodo.org/record/1495335.XlqwUZP7S8o. doi:.
Not in our library10.5281/zenodo.1495335
- 33.
F. Isensee, P. Jger, J. Wasserthal, D. Zimmerer, J. Petersen, S. Kohl, J. Schock, A. Klein, T. Ro, S. Wirkert, P. Neher, S. Dinkelacker, G. Köhler, K. Maier-Hein, batchgenerators - a python framework for data augmentation, 2020, https://zenodo.org/record/3632567.Xlqnb5P7S8o. doi:.
Not in our library10.5281/zenodo.3632567
- 34.
Isensee F., Jaeger P.F., Kohl S.A.A., Petersen J., Maier-Hein K.H. nnU-Net: a self-configuring method for deep learning-based biomedical image segmentation. Nat. Methods. 2021;18(2):203-211.
Not in our library10.1038/s41592-020-01008-z
- 35.
- 36.
Jungo A., Scheidegger O., Reyes M., Balsiger F. pymia: a Python package for data handling and evaluation in deep learning-based medical image analysis. Comput. Methods Programs Biomed. 2021;198:105796.
Not in our library10.1016/j.cmpb.2020.105796
- 37.
Kofler F., Ezhov I., Isensee F., Balsiger F., Berger C., Koerner M., Paetzold J., Li H., Shit S., McKinley R., Bakas S., Zimmer C., Ankerst D., Kirschke J., Wiestler B., Menze B.H. Are we using appropriate segmentation metrics? Identifying correlates of human expert perception for CNN training beyond rolling the DICE coefficient. arXiv:2103.06205 [cs, eess]. 2021.
Not in our library
- 38.
N. Ma, W. Li, R. Brown, Y. Wang, B. Gorman, Behrooz, H. Johnson, I. Yang, E. Kerfoot, Y. Li, M. Adil, Y.-T. Hsieh, charliebudd, A. Aggarwal, C. Trentz, adam aji, B. Murray, G. Daroach, P.-D. Tudosiu, myron, M. Graham, Balamurali, C. Baker, J. Sellner, L. Fidon, A. Powers, G. Leroy, Alxaline, D. Schulz, Project-MONAI/MONAI: 0.5.0, 2021, https://zenodo.org/record/4679866.YImZHZNKgWo. doi:.
Not in our library10.5281/zenodo.4679866
- 39.
Mancolo F. Eisen: a python package for solid deep learning. arXiv:2004.02747 [cs, eess]. 2020.
Not in our library
- 40.
Ranzini M.B.M., Fidon L., Ourselin S., Modat M., Vercauteren T. MONAIfbs: MONAI-based fetal brain MRI deep learning segmentation. arXiv:2103.13314 [cs, eess]. 2021.
Not in our library
Cited by papers we hold 3
Reads
Read by people on this page
None yet.
Checked or read by AI through naulon
None yet.
A person counts once a day per paper. We keep no cookie and no address: a reader is a hash that changes every day. Any month under five reads shows no number.
Are you an author?
Is this your paper?
Claim it to add your note and be paid when agents cite it. Free.