This project provides basic Geant4 simulation for a PET scanner, and a set of analysis examples that use the output of the simulation.
Requires Geant4 installation: https://geant4.web.cern.ch/
Once Geant4 is available on your system, be sure to set up the environment as follows:
source $GEANT4_myPath/share/Geant4-*/geant4make/geant4make.sh
Now clone this repository and compile (requires CMake):
git clone https://github.com/bwynneHEP/SimplePetScanner
cd SimplePetScanner
make
Run the compiled executable with command line arguments to set the details of the simulation, e.g.:
build/SimplePetScanner -n 1 --gui --detector SiemensBlock --source LinearF18
Set the number of events to simulate.
Activate the gui (omit this argument to produce output data only).
Choose a detector geometry (Siemens or Explorer) and the granularity of the detector crystals. Panel, Block and Crystal modes are supported, corresponding to large detectors running the full axial length of the system, axial segmentation into smaller detector modules, and fully granualar simulation at the level of individual scintillator crystals.
Set the length of the detector in mm. The actual length in simulation will be rounded up to accommodate the discrete detector modules. Each detector geometry will take their default length unless this argument is specified.
Set the scintillator material used for the detector crystals. All supported materials are listed in src/CrystalMaterial.cpp. Each detector geometry will use their default material unless this argument is specified.
Set the radioactive source, either a radioisotope tracer in a capillary (Linear) or the intrinsic detector background. For a linear source, F18, Zr89, C11, O15, N13, Rb82 and Ga68 isotopes are supported. For the detector background, the detector geometry (Siemens or Explorer) should be specified, Lu176 decays will be assumed.
Shift the linear source in the negative direction of the y-axis. If this argument is non-zero and provided along with the --nAluminiumSleeves argument, the sensitivity phantom is shifted as well.
Set the length of the phantom in mm. If a linear radioisotope source is selected, the length of the capillary will be equivalent to the length of the phantom. This option will set the length of the scatter phantom or the sensitivity phantom depending on which one is selected.
Override the default output file name (hits.csv) to allow multiprocessing.
Create output csv file containing the information about the radioactive decay. For now it includes only the values of the positron range for each event. The file is created only if this argument is specified in the running command.
Override the default random seed.
Create a sensitivity phantom with the corresponding number of aluminum sleeves. The number of sleeves has to be an integer from 1 to 5. If the option is not called, the scatter phantom will be created by default.
Example Jupyter notebooks can be found in the analysis directory, along with helper functions. Commands that run the simulation from within the notebooks assume the relative path of the simulation executable, so please launch the notebooks from within the analysis directory.
Includes code from https://github.com/katarinazatkova/PET-material-1 and https://gitlab.cern.ch/geant4/geant4/tree/master/examples/basic/B3