Python routines to analyze NEMA image quality phantom scans.
Georg Schramm
We recommend using the Anaconda Python distribution to create a conda virtual environment for pynemaiqpet
.
The installation consists of three steps:
- (Optional) Install the Anaconda or Miniforge Python distribution to gain access to the
conda
ormamba
package manager. - Create a conda virtual environment and install the
pynemaiqpet
Python package and command-line tools fromconda-forge
.
Note: You can also install the package from pypi using pip install, but we recommend the installation from conda-forge as explained below.
You can either install Anaconda or use the community-driven Miniforge distribution. Find more information and downloads here.
To create a virtual conda environment containing the pynemaiqpet
Python package and command-line tools, run:
conda create -c conda-forge -n pynemaiqpet pynemaiqpet
After installation, activate the environment by running:
conda activate pynemaiqpet
pip install pynemaiqpet
To test your installation, execute the following commands in Python:
import pynemaiqpet
print(pynemaiqpet.__version__)
print(pynemaiqpet.__file__)
Alternatively, you can check the command-line tool's help page:
pynemaiqpet_wb_nema_iq -h
To analyze a PET reconstruction of the NEMA whole-body phantom stored in DICOM format in the folder my_pet_recon
, use the following command:
pynemaiqpet_wb_nema_iq my_pet_recon --output_dir my_pet_recon_results --show --verbose
To apply an additional isotropic Gaussian post-filter to the reconstructed image before analysis, use the --fwhm_mm
argument. For example, to apply a filter with a full width at half maximum (FWHM) of 5.0 mm:
pynemaiqpet_wb_nema_iq my_pet_recon --output_dir my_pet_recon_results_5mm_fwhm_gauss --show --verbose --fwhm_mm 5.0
Note: This GitHub repository contains two example NEMA reconstructions in the data subfolder.
If you need to analyze many reconstructions stored in different dicom folders,
have a look at the vision_earl.py
or dmi_earl.py
example python scripts in the scripts subfolder that show
how to do that efficiently in python.