Skip to main content

Tools for loading, augmenting and writing 3D medical images on PyTorch.

Project description

TorchIO

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 All Contributors
Docs Documentation status
Build Build status
Coverage Coverage status Coverage Status
Code Code quality Code maintainability
Notebook Google Colab
Social Slack

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:

Pérez-García et al., 2020, TorchIO: a Python library for efficient loading, preprocessing, augmentation and patch-based sampling of medical images in deep learning.

BibTeX entry:

@misc{fern2020torchio,
    title={TorchIO: a Python library for efficient loading, preprocessing, augmentation and patch-based sampling of medical images in deep learning},
    author={Fernando Pérez-García and Rachel Sparks and Sebastien Ourselin},
    year={2020},
    eprint={2003.04696},
    archivePrefix={arXiv},
    primaryClass={eess.IV}
}

Getting started

See Getting started for installation instructions, a Hello, World! example and a comprehensive Jupyter notebook tutorial on Google Colab.

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

🤔

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

History

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.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

torchio-0.17.17.tar.gz (23.2 MB view details)

Uploaded Source

Built Distribution

torchio-0.17.17-py2.py3-none-any.whl (100.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file torchio-0.17.17.tar.gz.

File metadata

  • Download URL: torchio-0.17.17.tar.gz
  • Upload date:
  • Size: 23.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.48.1 CPython/3.7.1

File hashes

Hashes for torchio-0.17.17.tar.gz
Algorithm Hash digest
SHA256 e8b8a16c6df7da0cb271908024bbd67c6bf01526bd3931c34b9bf71c6a7935e0
MD5 14acf8730f71179431c276046cb64bb8
BLAKE2b-256 3d6b1fae1435282dc2e83381cbfc965da41b7202dd82e8f78143797f876437d1

See more details on using hashes here.

File details

Details for the file torchio-0.17.17-py2.py3-none-any.whl.

File metadata

  • Download URL: torchio-0.17.17-py2.py3-none-any.whl
  • Upload date:
  • Size: 100.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.48.1 CPython/3.7.1

File hashes

Hashes for torchio-0.17.17-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 223344bc2419285f986fb25006a4ca605036073f0a925ef82bee2e7f2fc244af
MD5 99b8122b9ec55d684185aca45b49e723
BLAKE2b-256 a2a157426e2cf7e94e1347bce547c6e5f8cbbf395ec58ca28797afc1a7beaf1a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page