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.
Training is inspired by the description in [1] and is implemented with [PyTorch](https://pytorch.org/).
For the optimization of hyperparameters, a random search procedure [2] is implemented.
To compute attenuation-corrected reconstructions, the script TODO implements the post-reconstruction attenuation correction (PRAC) [3] algorithm.
The open-source tomographic reconstruction software [STIR](https://stir.sourceforge.net/) is used for this.
Reconstructions can be evaluated using the mean squared error or the normalized mean absolute error.
While there is also code to evaluate polar maps, they cannot be generated here.
For the purpose of the paper, grayscale polar maps were generated the Cedars-Sinai Cardiac Suite [4].
## Results
## 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`
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) 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
## References
*`Shi et al. "Deep learning-based attenuation map generation for myocardial perfusion SPECT". 2020 In: European Journal of Nuclear Medicine and Molecular Imaging 47.10`
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).