Skip to content

Small tools to analyse the PET performance according to the NEMA protocols

Notifications You must be signed in to change notification settings

granadogmarc/performance-PET

Repository files navigation

PET Performance Analysis Tools

Analysis tools for GATE PET simulation output. All programs accept command-line arguments for flexible usage.

Building

mkdir build && cd build
cmake ..
make

Requires ROOT 6.x with MathCore, Hist, and Tree components.

Programs

Sensitivity

Single-file sensitivity analysis.

./Sensitivity --input <file.root> [options]

Options:
  --input <file>      Input ROOT file (required)
  --output <file>     Output PNG file (default: sensitivity_output.png)
  --activity <value>  Activity in MBq (default: 0.01)
  --time <value>      Scanning time in seconds (default: 100000)
  --bins <value>      Number of histogram bins (default: 180)
  --binsize <value>   Bin size in mm (default: 2.78)
  --scanner <type>    Scanner type: GE or CM (default: GE)
  --help              Show help message

new_Sensitivity

Multi-file sensitivity comparison with auto-detection of scanner type from filename.

./new_Sensitivity [options] <file1.root> [file2.root] ...

Options:
  --output <file>     Output PNG file (default: sensitivity_comparison.png)
  --activity <value>  Activity in MBq (default: 0.001)
  --time <value>      Scanning time in seconds (default: 100000)
  --help              Show help message

Note: Filenames should contain 'CM' or 'GE' for scanner type detection,
      and '25cm' or '100cm' for auto-labeling.

CTR

Coincidence Time Resolution analysis with Gaussian fitting.

./CTR --input <file.root> [options]

Options:
  --input <file>          Input ROOT file (required)
  --output <file>         Output PNG file (default: CTR_output.png)
  --bins <value>          Number of histogram bins (default: 300)
  --range-min <value>     Histogram minimum in ps (default: -150)
  --range-max <value>     Histogram maximum in ps (default: 150)
  --doi-correction <val>  DOI correction factor in ps/layer (default: 0, disabled)
  --help                  Show help message

NECR

Noise Equivalent Count Rate calculation for multiple activity levels.

./NECR [options]

Options:
  --dir <path>          Input directory (default: ../rootOutput/)
  --activities <list>   Comma-separated activity values in MBq
                        (default: 0.5,1,1.5,2,2.5,3,3.5,4,4.5,5,5.3)
  --length <value>      Detector length in cm (default: 100)
  --volume <value>      Phantom volume in ml (default: 22656)
  --time <value>        Stop time in seconds (default: 1)
  --date <string>       Date string for filename (default: 18_04_25)
  --output <file>       Output CSV file for results (optional)
  --help                Show help message

Example:
  ./NECR --activities 1,2,3,4,5 --length 100 --output results.csv

test_DOI

Depth of Interaction analysis comparing multiple files.

./test_DOI [options] <file1.root> [file2.root] ...

Options:
  --output <file>       Output PNG file (default: DOI_output.png)
  --bins <value>        Number of histogram bins (default: 25)
  --range-max <value>   Histogram maximum in mm (default: 24)
  --scale <value>       Scale factor for layerID (default: 1.0)
  --labels <list>       Comma-separated legend labels (default: auto from filename)
  --help                Show help message

Example:
  ./test_DOI --labels "PbWO4,LYSO" file1.root file2.root

Comparison

Compare Singles trees from two ROOT files.

./Comparison --input1 <file1.root> --input2 <file2.root> [options]

Options:
  --input1 <file>       First input ROOT file (required)
  --input2 <file>       Second input ROOT file (required)
  --label1 <name>       Label for first file (default: File 1)
  --label2 <name>       Label for second file (default: File 2)
  --output-prefix <str> Output filename prefix (default: comparison)
  --crystal-bins <n>    Number of bins for crystalID (default: 59)
  --layer-bins <n>      Number of bins for layerID (default: 10)
  --submodule-bins <n>  Number of bins for submoduleID (default: 59)
  --help                Show help message

Outputs: {prefix}_subModuleID.png, {prefix}_crystalID.png, {prefix}_layerID.png

first_analysis

Compare Hits and Singles trees between monolithic and segmented configurations.

./first_analysis --input1 <file1.root> --input2 <file2.root> [options]

Options:
  --input1 <file>       First input ROOT file (required)
  --input2 <file>       Second input ROOT file (required)
  --label1 <name>       Label for first file (default: Monolithic crystal)
  --label2 <name>       Label for second file (default: Segmented crystal)
  --output-prefix <str> Output filename prefix (default: first_analysis)
  --crystal-bins <n>    Number of bins for crystalID (default: 59)
  --layer-bins <n>      Number of bins for layerID (default: 10)
  --submodule-bins <n>  Number of bins for submoduleID (default: 59)
  --help                Show help message

Outputs: {prefix}_crystalID.png, {prefix}_layerID.png, {prefix}_submoduleID.png

Input Data

Programs expect ROOT files from GATE simulations containing trees:

  • Coincidences - for sensitivity, CTR, NECR, DOI analyses
  • Singles - for comparison analyses
  • Hits - for first_analysis

Default input directory: ../rootOutput/

About

Small tools to analyse the PET performance according to the NEMA protocols

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published