OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Developer Tools & SDKs

Torchio

Torchio is an open-source Python library for medical-image processing and augmentation in AI and deep-learning workflows, with a documented PyTorch ecosystem.

Independent OpenViST project profile, based on linked sources.

Torchio — OpenViST project profile in AI Developer Tools & SDKs.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use Torchio when a medical-imaging project needs image processing or random augmentation within a Python deep-learning workflow.

Who it is for

  • Developers building Python-based medical-imaging machine-learning workflows.
  • Researchers preparing medical imaging data for deep-learning experiments.

Documented uses

  • Apply random blur, flips or noise to medical images.
  • Apply affine or elastic transformations during image augmentation.
  • Prepare medical imaging data for machine-learning experiments.
Before you choose

Requirements & limits

  • Torchio is a Python library, so use involves a development workflow rather than a standalone image-editing interface.
  • The repository links to installation instructions, a Hello, World! example and longer tutorials.
  • The project is licensed under Apache-2.0.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Install TorchIO and verify the CLI version

Install TorchIO with pip and check the installed version.

Before you start

  • A Python environment with pip.

Steps

  1. Run the command below.

    Documented command
    pip install torchio
  2. Run torchio --version to verify the installation.

Expected outcome

TorchIO is installed, and its CLI prints a version.

Guide limitations

  • Optional extras are needed for NIfTI-Zarr support, cloud storage integrations, or the NiiVue Jupyter viewer.
Source-based practical guide

Build and apply a TorchIO augmentation pipeline to a batch

Load paired T1 and segmentation images as subjects, apply random transforms to a batch on a device, and inspect the resulting image tensor.

Before you start

  • TorchIO v2 experimental pre-release, as the example is on the v2 development documentation.
  • Subject directories containing t1.nii.gz and seg.nii.gz files.
  • A CUDA or MPS device for the documented GPU/device batch example.

Steps

  1. Create a tio.Subject for each directory with tio.ScalarImage for T1 and tio.LabelMap for segmentation.

  2. Create a tio.Compose pipeline with tio.Flip(), tio.Affine(degrees=(-15, 15)), tio.Standardize(), and tio.Noise(std=(0, 0.1)).

  3. Convert the subjects to a batch with tio.SubjectsBatch.from_subjects(subjects) and move it to cuda or mps.

  4. Apply the pipeline to the batch and inspect augmented.t1.data.shape and .device.

Expected outcome

The transformed batch contains augmented image and segmentation data; the documented example reports T1 tensor shape `(4, 1, 256, 256, 176)` on `cuda:0`.

Guide limitations

  • TorchIO v2 is an experimental pre-release under active development and may contain bugs or breaking changes; v1 is identified as the current stable release.
  • The shown example uses four subject directories and a CUDA device for its reported output.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
13 October 2026
Original website title
TorchIO-project/torchio · Official homepage title · retained in its source language