Newer
Older
Repository containing the code of the paper `Deep Learning Approximation of Attenuation Maps for Myocardial Perfusion SPECT with an IQ·SPECT Collimator`.
Using this code, it is possible to train a deep neural network to predict attenuation maps from non-attenuation-corrected reconstructions.
The training is inspired by the description in [1] and is implemented with [PyTorch](https://pytorch.org/).
A random search procedure [2] is implemented for the optimization of hyperparameters.
To compute attenuation-corrected reconstructions, the [script](/mu_map/scripts/compute_recons.py) implements the post-reconstruction attenuation correction (PRAC) algorithm [3].
It uses the open-source tomographic reconstruction software [STIR](https://stir.sourceforge.net/).
Reconstructions can be evaluated using the mean squared error or the normalized mean absolute error.
Polar maps cannot be generated with this code, but they can be evaluated.
For the purposes of this paper, grayscale polar maps were generated using the Cedars-Sinai Cardiac Suite [4].
### Comparison of Real and Predicted Attenuation Maps
From left to right: a real attenuation map, the corresponding deep learning prediction, and their difference.

## Release ToDo's
* Update dependency versions in pyproject.toml an requirements.txt
* Test installation instructions
* Add illustrations:
* Gif of the comparison between a predicted and an actual attenuation map
* polar maps
## Installation
Installation was tested with Ubuntu 20.04 and 22.04.
1. Create and load a virtual environment `python -m venv .venv && source .venv/bin/activate`
2. Install python requirements `pip install -r requirements.txt`
### STIR
STIR is required to project and reconstruct scans (using the PRAC algorithm).
For its installation, this repository contains STIR as a submodule as well as an installation script.
To install STIR run:
1. `git submodule init && git submodule update`
2. `cd libs && ./install.sh && cd ..`
### Tesseract OCR
Because we could not export perfusion scores from polar maps generated with the Cedars-Sinai Cardiac Suite, but only RGB images with scores written in a green font, we added a [script](/mu_map/polar_map/get_perfusion.py) to help extract these scores.
This script uses [Tesseract](https://tesseract-ocr.github.io/) to automatically parse these numbers from the image.
To install tesseract, run:
`sudo apt install tesseract-ocr`
## Usage
This code is not intended for direct usage as data structures likely differ.
## Features
* cGAN training
* Random search [2] for hyperparameter optimization
* PRAC [3] algorithm
* Evaluation of polar maps
1. L. Shi et al. “Deep learning-based attenuation map generation for myocardial perfusion SPECT”. In: European Journal of Nuclear Medicine and Molecular Imaging 47 (2020). doi: [10.1007/s00259-020-04746-6](https://doi.org/10.1007/s00259-020-04746-6).
2. J. Bergstra and Y. Bengio. “Random Search for Hyper-Parameter Optimization”. In: Journal of Machine Learning Research 13 (2012).
3. H. Liu et al. “Post-reconstruction attenuation correction for SPECT myocardium perfusion imaging facilitated by deep learning-based attenuation map generation”. In: Journal of Nuclear Cardiology 29 (2021). doi: [10.1007/s12350-021-02817-1](http://doi.org/10.1007/s12350-021-02817-1).
4. G. Germano et al. “Quantitation in gated perfusion SPECT imaging: The Cedars-Sinai approach”. In: Journal of Nuclear Cardiology 14 (2007). doi: [10.1016/j.nuclcard.2007.06.008](https://doi.org/10.1016/j.nuclcard.2007.06.008).