PyTomography is a python library for medical image reconstruction. It uses the functionality of PyTorch to (i) enable fast GPU-accelerated reconstruction and (ii) permit easy integration of deep-learning models in traditional reconstruction algorithms. If you use PyTomography in your own research, please cite the following:


Supported Modalities

  • Single Photon Computed Emission Tomography (SPECT)

    • System matrix modeling includes attenuation correction, PSF modeling, scatter correction

  • Positron Emission Tomography (PET)

    • Listmode

    • Time-of-flight

    • Corrections for attenuation/normalization, and options for PSF modeling.

Reconstruction Algorithms

  • Filtered Back Projection (FBP)

  • Statistical Iterative Algorithms

    • OSEM / MLEM

    • OSEMOSL (see here)

    • BSREM (see here)

    • KEM (see here)

    • DIPRecon (see here)

Options exist to include anatomical information (such as MRI/CT) when using priors/regularization.

Supported Datatypes


    • Ability to open and align SPECT/CT data and create attenuation maps

    • Repository of collimator parameters for different scanners for obtaining PSF information

  • SIMIND output files (SPECT)

    • Functionality to combine multiple sets of projections (representing different organs/regions) into a single set of projection data

  • GATE output files (PET)

    • ability to read ROOT files generated from gate simulations

    • generation of scanner lookup tables (detector coordinates) from GATE macro files

  • PETSIRD data files (PET)

    • ability to read PETSIRD files, which contain all detected events and scanner geometry information


Firstly, it is important that all your graphics card drivers are up to date. To ensure this, go to this link, enter your graphics card information, and download/install the newest possible driver. It is also recommended that you download anaconda using this link to manage your python environments.

Firstly, create a pytomography virtual environment using anaconda:

conda create --name pytomography_env

Then you can activate your environment, and install PyTomography:

conda activate pytomography_env
pip install pytomography

If you want to use the PET reconstruction options available, you need to additionally follow the installation instructions for parallelproj at this link.


Be sure to check out Tutorials for some simple examples. If you wish to make a contribution, please read the Developer’s Guide.

User Forum#

If you have any questions about how to use the software, feel free to ask them on the discourse page at this link.


Example 1: SPECT/CT Images of patient receiving targeted radionuclide therapy with Lu177 DOTATATE for neuroendocrine tumours (4 cycles of 7.4 GBq/cycle administered every 8 week; shown is first cycle). From left to right: OSEM (50it/8ss), BSREM (50it/8ss) using the RDP prior with anatomical weighting, and KEM (50it/8ss).

Example 2: Ultra high resolution PET/MR brain phantom ground truth and reconstructions with time-of-flight. PET Monte Carlo acquisition data was obtained via simulation of a Siemens mMR scanner (with 550 ps time-of-flight resolution) in GATE. From top to bottom: sample axial, coronal, and sagittal slices. From left to right: T1-weighted MR image (inverse contrast), ground truth PET concentration, high count (630 million events) reconstruction with OSEM (4it20ss), low count recon (35 million events) with OSEM (80it/1ss) and low count recon (35 million events) with the DIPRecon method (100it). *