installationguide_v5.0.0

39
GATE Installation Guide GATE - Geant4 Application for Tomographic Emission : a simulation toolkit for PET and SPECT OpenGATE Collaboration http://www.opengatecollaboration.org Version 5.0.0 10 June 2009

Upload: ivan-moises-toro-garcia

Post on 26-Oct-2015

35 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: InstallationGuide_v5.0.0

GATE Installation Guide

GATE - Geant4 Application for Tomographic Emission :a simulation toolkit for PET and SPECT

OpenGATE Collaboration

http://www.opengatecollaboration.org

Version 5.0.010 June 2009

Page 2: InstallationGuide_v5.0.0
Page 3: InstallationGuide_v5.0.0

Authors

OpenGATE spokesperson :I. Buvat (CNRS-IMNC Paris)

OpenGATE technical coordinator : S. Jan (CEA-SHFJ Orsay)

Authors : S. Jan, G. Santin, D. Strul, S. Staelens, K. Assié, D. Autret,S. Avner, R. Barbier,M. Bardiès, P. M. Bloomfield, D. Brasse, V. Breton, P. Bruyndonckx, I. Buvat, A. F. Chatzi-ioannou, Y. Choi, Y. H. Chung, C. Comtat, D. Donnarieix, P. Descourt, L. Ferrer, S. J. Glick,C. J. Groiselle, D. Guez, P.-F. Honore, S. Kerhoas-Cavata, A. S. Kirov, V. Kohli, M. Koole,M. Krieguer, D. J. van der Laan, F. Lamare, G. Largeron, C. Lartizien, D. Lazaro, M. C. Maas,L. Maigne, F. Mayet, F. Melot, C. Merheb, E. Pennacchio, J. Perez, U. Pietrzyk, F. R. Ran-nou, M. Rey, N. Rehfeld, D. R. Schaart, C. R. Schmidtlein, L. Simon, S. Stute, T. Y. Song,J.-M. Vieira, D. Visvikis, R. Van de Walle, E. Wieërs, C. Morel

Special Thanks : Geant4 Collaboration

The GATE mailing list :You are encouraged to participate in the dialog and post yoursuggestion or even implementationon the gate-users mailing list, the GATE mailing list for users.You can subscribe to the gate-users mailing list, by registering at the GATE web site :http://www.opengatecollaboration.orgIf you have a question, it is very likely that it has been asked, answered, and stored in thearchives. Please use the search engine to see if your question has already been answered beforesending a mail to the GATE talk.

iii

Page 4: InstallationGuide_v5.0.0
Page 5: InstallationGuide_v5.0.0

Contents

1 Installing GATE on LINUX 31.1 Recommended configuration . . . . . . . . . . . . . . . . . . . . . . . . .. . 31.2 Installing Geant4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 31.3 Installing GATE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41.4 GATE configuration script . . . . . . . . . . . . . . . . . . . . . . . . . .. . 5

2 Installing Gate on OsX (Panther-Tiger) 92.1 Preliminary remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . 92.2 Platform tested . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .92.3 Prerequisite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .92.4 Manual installation of needed packages . . . . . . . . . . . . . .. . . . . . . 92.5 Installing Geant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 102.6 Installing Gate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 102.7 Remarks: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

3 PET Benchmark 133.1 Benchmark configuration description . . . . . . . . . . . . . . . .. . . . . . . 133.2 Benchmark results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .16

4 SPECT benchmark 214.1 Loading the SPECT benchmark package . . . . . . . . . . . . . . . . .. . . . 214.2 SPECT benchmark: moving source . . . . . . . . . . . . . . . . . . . . .. . . 214.3 Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254.4 Results : SPECT benchmark . . . . . . . . . . . . . . . . . . . . . . . . . .. 31

1

Page 6: InstallationGuide_v5.0.0
Page 7: InstallationGuide_v5.0.0

Chapter 1

Installing GATE on LINUX

This chapter described the installation procedure of GATE .It comprises two steps :

• Install Geant4 and all helper tools required for Geant4 (CLHEP);

• Install GATE itself.

This chapter thus includes first (sec. 1.1) a brief overview of the recommended configura-tions (as well as a list of tested ones), a short introductionto the installation of Geant4 (sec.1.2),then the installation of GATE itself on Linux (sec. 1.3 and 1.4).

It should be highlighted that tools needing external libraries or packages may only be acti-vated if the corresponding external system is installed. Itis the user’s responsability to checkthis and to set environement variables to control the compilation. Except for Geant4, which isclosely related to GATE , we refer the user to the Installation Guide of the external libraries/toolsfor their installation.

1.1 Recommended configuration

Important point at this level:

The recommandedGeant4, compiler and software versions for CLHEP, ROOT and LMFare available on the registered users area of the GATE web site.

1.2 Installing Geant4

1.2.1 Basics

To run GATE , the following software must be properly installed in your computing environ-ment:

• The CLHEP (CERN software) headers and libraries ;

• The Geant4 headers, data files and libraries.

3

Page 8: InstallationGuide_v5.0.0

1.3 Installing GATE

The sources and data files for these packages may be found on the corresponding CERN web-sites : G4 [1] (click on the Previous Releases of Geant4 link to get the required Geant4 release)and CLHEP [2].The installation of both libraries can be done by any user,i.e. no super-user privileges are re-quired.Remember to install CLHEP first, as its libraries are needed for Geant4. In addition, you shouldalso install any Geant4 helper you wish to use, especiallyOpenGL if required, before installingGeant4 itself.You can either download the source codes and compile the libraries or download precompiledpackages which are available for a number of platform-compiler comninations. If you chooseto or have to compile the packages, you will need :

• a C++ compiler ;

• the GNU version ofmake.

1.2.2 Geant4 helpers

In addition to these basic tools, you should also haveOpenGL installed, since it is the simplestand most commonly used image viewer. On a lot of commercial platforms,OpenGL is installedby default. If you may need to installOpenGL, the sources for this library are available fromthe OpenGL homepage OpenGL homepagehttp://www.opengl.org/ [3].Other graphic systems or packages include for instance DAWNhttp://geant4.kek.jp/ tanaka/ [4]or VRML browser.

The ROOT data analysis package may also be needed, for post-treatment or the use of theGATE online plotter (allowing to visualise various simulation parameters and results in realtime). ROOT is supported for numerous platforms and a variety of precompiled packages areavailable from the Root Homepagehttp://root.cern.ch/ [5].

1.3 Installing GATE

There is no automated procedure for the GATE installation. Following the 5 next steps to installGATE :

1. Download the GATE sources and data files into a new directory;

2. Set the environment variable GATEHOME to this directory;

3. Adapt the GATE configuration scriptenv_gate.csh to your environment (next section);

4. Launch the configuration scriptenv_gate.csh by typingsource env_gate.csh;

5. Typemake or gmake (depending on the name for the GNU version ofmake on yoursystem).

- 4 -

Page 9: InstallationGuide_v5.0.0

1.4 GATE configuration script

1.4 GATE configuration script

1.4.1 Basics

The GATE C shell configuration scriptenv_gate.csh performs 2 tasks :

• it looks for and launches the Geant4 configuration scriptenv.csh, to make sure that allGeant4 environment variables are properly set ;

• it sets a number of environment variables needed by GATE . Those essentially are meantto define the various data output options.

There are 3 prerequisites for this script to work properly :

• You must define the environment variable G4INSTALL so that itpoints to the directorywhere Geant4 is installed;

• You must make sure that this directory contains a Geant4 configuration scriptenv.csh;

• You must define the environment variable G4VERSION so that itpoints to the releasenumber of Geant4. If you use Geant4 release 8.1, patch-02, G4VERSION should be setto 8.1.

If any of these conditions is not met, the script won’t know how to configure the Geant4environment variables and will abort.

The following Geant4 releases are supported:

• 4.0 to 4.1

• 5.0 to 5.2

• 6.0 to 6.2

• 7.0 to 7.1

• 8.0 to 8.1

• 9.0 to 9.2

Any other release is not supported and will make the script toabort.To avoid mismatch between the variables G4INSTALL and G4VERSION, it is recom-

manded that the variable G4VERSION is used in the definition of G4INSTALL. For example,if you use Geant4 release 9.0 installed in/opt/geant4.9.0, then

setenv G4VERSION 9.0setenv G4INSTALL "/opt/geant4.${G4VERSION}"

Assuming that the three conditions are met, the script is ready to be used. However, youmay wish to tune the GATE configuration variables before you launch it. This is explained inthe next section.

- 5 -

Page 10: InstallationGuide_v5.0.0

1.4 GATE configuration script

1.4.2 GATE environment variables

The GATE configuration script tries to set a number of data output options according to what isinstalled on your system. Each such option is enabled by a line similar to the one below :

setenv G4ANALYSIS_USE 1This line defines an environment variable, which is passed tothe compiler by the GATE make-file. This then enables the compilation of some specific sections of the GATE source codes. Todisable this option, you simply need to comment out the configuration line, as shown below :

#setenv G4ANALYSIS_USE 1When this is done, the relevant codes are no longer compiled,so that the data output option iscompletely removed from the GATE program.We give below the list of GATE environment variables and how they are set :

• G4ANALYSIS_USE

This variable enables the use of the data output and analysisfeatures by GATE and alwaysis set by default. Unsetting it disables all data output modules : the simulation getssomewhat faster, but there is no data output whatsoever.

• G4ANALYSIS_USE_FILEThis variable enables the use of the ASCII file data output. This output is simple andworks on all platforms. However, the output files generated may be pretty huge. Whilethis variable is set by default, you can unset it if you don’t plan to use the ASCII datafiles.

• G4ANALYSIS_USE_ROOTThis variable enables the use of the features based on the ROOT libraries. These featuresinclude the ROOT data output and the real-time plotter. These features are fairly powerful,but they require the ROOT librairies to be installed on your platform. As a security, thisvariable is set only if the script detects that ROOT is installed. To do so, the ROOTSYSenvironment variable should point to the home directory of ROOT. Even if ROOT isinstalled on your system, you may wish to unset this variableif you don’t plan to use theROOT output file or the real-time plotter.

• G4ANALYSIS_USE_ROOT_PLOTTER

This variable enables the use of the ROOT-based real-time plotter. As a security, thisvariable is set only if the script detects that ROOT is installed. As the real-time plotter usesthe X protocol, there may be a computation speed penalty in using this option, especiallywhen running on a distant machine. Even if ROOT is installed,you may wish to unsetthis variable if you don’t need real-time plots (batch runs).

• G4ANALYSIS_USE_LMF

- 6 -

Page 11: InstallationGuide_v5.0.0

1.4 GATE configuration script

This variable enables the use of the LMF file data output. As a security, this variable isset only if the script detects that the LMF libraries are installed on your system. Even ifthese libraries are installed, you may wish to unset this variables if you don’t plan to usethe LMF output file..

• G4ANALYSIS_USE_ECAT7

This variable enables the use of the ECAT7 file data output. Asa security, this variable isset only if the script detects that the ECAT7 libraries are installed on your system. Evenif these libraries are installed, you may wish to unset this variables if you don’t plan touse the ECAT7 output file.

• GATE_USE_OPTICAL

This variable enables the use of the optical transport features in GATE . When this variableis switched on, it is possible to generate and track optical photons. In order to compileGATE with this feature, it is necessary to have the libXML2[7] development packages(libxml2-dev) installed on your system. As a security, thisvariable is unset when theprogram xml2-config is not found on the system. This program should have been installedwith the aforementioned package. You may want to unset this variable when you do notwant to use the optical transport feature.

- 7 -

Page 12: InstallationGuide_v5.0.0
Page 13: InstallationGuide_v5.0.0

Chapter 2

Installing Gate on OsX (Panther-Tiger)

2.1 Preliminary remarks

As from Geant 4.5, Mac OsX is a ’verified configuration’ for theGeant4 Collaboration.

2.2 Platform tested

Hardware: Mac G5 and Mac Intel, Operating System: OsX 10.4.x

2.3 Prerequisite

• Apple Developper Tools (Xcode, current version 2.5 includes gcc 4.0).

• X11 (available in Mac OS installation disk)

2.4 Manual installation of needed packages

• clhep2 Several options are available:

– directly download precompiled library from http://proj-clhep.web.cern.ch/proj-clhep/DISTRIBUTION/clhep.htmlhttp://proj-clhep.web.cern.ch/proj-clhep/DISTRIBUTION/clhep.html

– download sources from the web page and install the packages:

cd /to/directory/where/you/placed/CLHEP/sources\\ ./configure --prefix=/a/location/you/choose/

• ROOT You can get precompiled binaries for your system. Pay attention. You must don-wload the one that correspond to your system (gcc4.0/Intel or gcc4.0/PPC).Alternatively, you can get and compile the sources. Follow the installation process:

set $ROOTSYS to ’root’ directory\\cd $ROOTSYS\\

9

Page 14: InstallationGuide_v5.0.0

2.5 Installing Geant

./configure --prefix=/a/location/you/choose \\make && make install

2.5 Installing Geant

Geant4 current working version is 9.0p01Set G4INSTALL variable to your GEANT4 directoryThen install Geant ’normally’ with:

./configure --build

Remarks:

CLHEP variable should be set to the location of you CLHEP tree. X11 is in /usr/X11R6

The rest is simple enough...There may be some warning that errors were found at install, but these seem to be harmless...After installation is completed, generate env.csh et env.sh by

./configure

At this stage, it is indicated to TEST your Geant installation, by compiling and running somesexamples, novice could be a good start. Experience shows that most problems in Gate installa-tion are are in fact problems related to Geant installation.

2.6 Installing Gate

• download Gate sources from the Gate’s web site

• modify env_gate.csh and set GATEHOME and G4VERSION

• Build Gate:

source env\_gate.csh

make >& make.log (allows to keep a log).

Beside some harmless warning Gate builds fine...

- 10 -

Page 15: InstallationGuide_v5.0.0

2.7 Remarks:

2.7 Remarks:

Global variables set in our install (given as an example - modify the path accordingly...):

• G4INSTALL=/Users/manu/projets/Geant/geant4.9.0.p01

• ROOTSYS=/Users/manu/projets/root

• DYLD_LIBRARY_PATH=/Users/manu/projets/root/lib

• LD_LIBRARY_PATH=/Users/manu/projets/root/lib

Make sure that both X11 and X11sdk are installed (there are 2 files to download andinstall)

Check compiler version: cc -v (current answer: gcc version 4.0.1 (Apple Computer, Inc.build 5367))

- 11 -

Page 16: InstallationGuide_v5.0.0
Page 17: InstallationGuide_v5.0.0

Chapter 3

PET Benchmark

Two benchmarks, one for PET and one for SPECT, are included inthe GATE distribution.These benchmarks check the integrity of a GATE installationor upgrade. Each benchmarkconsists of the macros required to run the simulation, analyze simulation output, and generatefigures. In addition, a set of baseline figures are included tocompare the users results withthose from a correct run. The ROOT package is required to run the benchmarks and analyzetheir output.

3.1 Benchmark configuration description

The PET benchmark distribution contains the following GATEmacro files:

benchmarkPET.maccamera.macphantom.macphysics.macsources.macvisu.mac

The main macro file isbenchmarkPET.mac.By default, the visualization is disabled. To execute the benchmark without visualization,

type

Gate benchmarkPET.mac

To execute the benchmark with a visualization of the simulation setup, comment the followingline in benchmarkPET.mac:

/vis/disable

and uncomment this one:

#/control/execute visu.mac

and execute the main macro file after the start of GATE :

13

Page 18: InstallationGuide_v5.0.0

3.1 Benchmark configuration description

GatePreInit> /control/execute benchmarkPET.mac

On a 2 GHz processor (xeon 5130), the computing time will be around 5 hours and the sizeof the simulation ROOT output will be around 72 MBytes.

3.1.1 Scanner description

The PET benchmark simulates a whole-body scanner that does not correspond to any existingsystem. The scanner is described in the macro filecamera.mac. It consists of eight detectorheads arranged in a 88 cm diameter and 40 cm axial length octagonal cylinder. Each head ismade of 400 detector blocks and each block is a5 × 5 array of dual-layer BGO-LSO crystals.

The cylindricalPET system is used to describe the logical organization of the scanner. Therelationship between the physical components of the scanner and the hierarchical levels of thesystem is described in Table 3.1:

Physical component cylindricalPET systemhead rsectormodule moduleblock submodulecrystal crystalLSO layer0BGO layer1

Table 3.1: Relationship between the physical components ofthe scanner and the hierarchicallevels of the system

Each head is shielded at both end of the axial field-of-view with a 1 mm thick rectangularlead plate. In addition, 0.5 mm thick rectangular tungsten plates are placed in front of each headto provide a partial axial collimation (partial septa). There are three plates per head, spaced by10 cm along the scanner axis (see Figure 3.1).

The LSO and BGO crystals are defined as crystal sensitive detector. A blurring of 26 % at511 keV is applied to the energy deposed in the crystals. A detected gamma is further processedonly if its energy falls between 350 and 650 keV. A coincidence is defined when two gammasare detected within 120 ns. A large coincidence time window is used in order to record a largenumber of random coincidences despite low activity levels.

3.1.2 Phantom description

The phantom is described in the macro filephantom.mac. It consists of a 20 cm diameter and70 cm long cylinder made of water. The cylinder is centered inthe field-of-view of the scanner.

3.1.3 Sources description

The sources are described in the macro filesources.mac. Two 68 cm length and 1 mm diameterline sources are inserted in the water cylinder, at a radial distance of 2 cm from the cylinder

- 14 -

Page 19: InstallationGuide_v5.0.0

3.1 Benchmark configuration description

Figure 3.1: Illustration of the PET benchmark setup. The end-shieldings are represented inwhite and the partial axial collimators in blue. The BGO crystal layers are in yellow and theLSO crystal layers in green. The water phantom is in grey.

- 15 -

Page 20: InstallationGuide_v5.0.0

3.2 Benchmark results

axis. The first source is filled with F-18 and the second with O-15, both with an initial activityof 100 kBq. The fast production module for positron emissionis used and the half-lives of F-18and O-15 are explicitly set to 6586.2 and 122.24 s.

3.1.4 Selection of the physics processes

The selection of the physics processes is described in the macro file physics.mac. The standardelectromagnetic package is used for Compton scattering andfor photoelectric effect. The lowenergy package is only used for Rayleigh scattering. To speed up the simulation, X-rays andsecondary electrons are not tracked; the electron energy cut is set to an equivalent of 30 cm andthe X-rays energy cut to 1 GeV.

3.1.5 Simulation protocol

The simulated acquisition is 4 minutes in duration, which represents about two O-15 half-lives.The source activities and the acquisition duration are set such that the PET benchmark runs inless than 5 CPU hours on a 2 GHz processor (xeon 5130 and the last release). The acquisitionis divided into two 2 minute frames; after the first frame, thegantry rotates by 22.5 deg. Onlycoincident events are recorded and written in the ROOT filebenchmarkPET.root. All otheroutputs are disabled. The water cylinder, the end-shieldings, and the axial collimators are de-fined as "phantom sensitive detectors". This allows for the selection, in the ROOT output, ofthe gammas that underwent a Rayleigh or Compton scattering in these materials before beingdetected.

3.2 Benchmark results

Approximately3.7 × 107 decays occur during the simulated acquisition and some7.0 × 105

coincidences are recorded and written in the ROOT output. Based on this output, several figuresand plots are calculated by the ROOT macrobenchmarkPET.C.

To run the macro, type:

root benchmarkPET.C

The plots are saved in the filebenchmarkPET.gif and the figures are printed in the ROOT con-sole.

3.2.1 Plots analysis

Seven plots are produced by the ROOT macro. They consist of 1-D or 2-D histograms withone entry per true coincidence (unscattered or scattered).A reference file is provided with thebenchmark (benchmarkPET_RootOutputReference.gif); it contains the plots obtained with onecorrect execution of the benchmark (see Figure 3.2).

The three plots in the upper row show the detection coordinates of the annihilation photonsin the detector heads. The first two plots ("Transaxial detection position") are 2-D histogramsof the X and Y coordinates, one per frame, and illustrate the rotation of the heads. The third

- 16 -

Page 21: InstallationGuide_v5.0.0

3.2 Benchmark results

-400 -200 0 200 400

-400

-200

0

200

400

Transaxial detection position, run 1

-400 -200 0 200 400

-400

-200

0

200

400

Transaxial detection position, run 2

-200 -150 -100 -50 0 50 100 150 2000

5000

Axial detection position

0 20 40 60 80 100 120140 160180 200220 240

2000

3000

4000

5000

6000

7000

O-15 decay

-200 -150 -100 -50 0 50 100 150 2000

2000

4000

6000

8000

Axial sensitivity

-200 -150 -100 -50 0 50 100 150 200

0.48

0.49

0.5

0.51

0.52

0.53

0.54

0.55

0.56

Axial scatter fraction

-5 -4 -3 -2 -1 0 1 2 3 4 50

500

1000

1500

2000

2500

3000

3500

4000

310×

Acolinearity Angle Distribution (deg)

0 50 100 150 200 2500

50

100

150

200

250

300

350

400

450 Delays: with coincidence sorterRandoms: eventID1 != eventID2

time1

Figure 3.2: Reference plots of the PET benchmark.

- 17 -

Page 22: InstallationGuide_v5.0.0

3.2 Benchmark results

plot ("Axial detection position") is a 1-D histogram of the Zcoordinate, both frames together,and illustrates the effect of the axial collimators at coordinates -100, 0, and +100. In additionto the detection position, the first two histograms contain also the emission coordinates of thepositrons inside the line sources.

Two decay time curves are overlayed in the left plot of the middle row ("O-15 decay"). Thered curve corresponds to the O-15 source and the blue curve tothe F-18 source. The result ofan exponential curve fit is superposed to the O-15 curve. These curves illustrate the decay ofboth sources.

The second plot in the middle row ("Axial sensitivity") illustrates the axial sensitivity ofthe scanner. For all unscattered coincidences, the axial position of the corresponding line-of-response is histogramed.

The third plot in the middle row ("Axial scatter fraction") shows the scatter fraction as afunction of the axial position.

The plot in the lower row ("Acollinearity Angle Distribution (deg)") shows the distributionof the deviation to 180 deg. of the angle between the two annihilation gammas. Unlike theother plots, this histogram is filled in GATE and is part of theROOT output. It should benoted that the selection of the annihilation photons is not based on the physical process thatproduced the photon (annihilation of the emitted positron with an electron), but rather on theenergy of the photon (greater than 450 keV) and on the occurrence of the photon (should be thefirst two photons radiated from the positron). As a result, there is a very slight contaminationwith Bremsstrahlung X-rays. The last plot compare the delaycoincidences generated with thenew coincidence sorter with the real random selected in the prompts coincidences with the ruleenventID1! = eventID2.

3.2.2 Figures analysis

Six physical variables are calculated by macro from the ROOToutput:

1. the total number of generated events;

2. the total number of random coincidences;

3. the total number of true unscattered coincidences;

4. the total number of true scattered coincidences;

5. the simulated O-15 half life;

6. the full-width-half-maximum of the annihilation gamma acollinearity angle.

Here is an example of the ROOT macro output for one correct execution of the benchmark:

************************************************************************************ ** G A T E P E T B E N C H M A R K R E S U L T S A N A L Y S I S ** ************************************************************************************

Acquisition start time = 0 [s]Acquisition stop time = 240 [s]

- 18 -

Page 23: InstallationGuide_v5.0.0

3.2 Benchmark results

O-15 decay factor = 0.546383F-18 decay factor = 0.987477O-15 initial activity = 100000 [Bq]F-18 initial activity = 100000 [Bq]O-15 decays = 1.31132e+07F-18 decays = 2.36994e+07==> Expected total number of decays during the acquisition is 3.68e+07 +/- 6067.34There are 3.68187e+07 recorded decaysThere are 312864 true unscattered coincidencesThere are 23639 random coincidencesThere are 371679 scattered coincidences==> there is a total of 709182 coincidences (true, scattered, and random)==> global scatter fraction = 0.542959==> absolute sensitivity = 0.849742 %

Measured O-15 half-life = 122.476 [s]Nominal O-15 half-life = 122.24 [s]

==> difference = 0.192912 %Gamma acollinearity FWHM = 0.584795 degree (expected: 0.58)

The PET benchmark has been run on twelve different system configurations. Two operatingsystems have been tested : Linux and Mac OS. The computing time for the PET benchmarkvaried between 4.5 and 10 hours (due to the clock processor).

The six PET physical variables characterizing the simulation results are shown in Table 3.2with their mean value and standard error obtained from the twelve system configuration sample.

variable type mean value σ

total decays during the acquisition3.6813 × 107±0.01 %

random coincidences 23536 ±0.20 %unscattered coincidences 312725 ±0.12 %scattered coincidences 370116 ±0.10 %simulated 15-Oxygen life time 121.85 s ±0.07 %gamma acollinearity angle 0.58 degree ±0.01 %

Table 3.2: Mean values and standard deviation of the physical variables studied with the PETbenchmark.

The results in Table 3.2 and, in particular, the standard deviations show that the main phys-ical simulation variables are stable within less than 1 %. Itis strongly recommended that theuser validates a new or updated GATE installation using thistable.

- 19 -

Page 24: InstallationGuide_v5.0.0

3.2 Benchmark results

- 20 -

Page 25: InstallationGuide_v5.0.0

Chapter 4

SPECT benchmark

The SPECT benchmark consists in a macro corresponding to thesimulation of a SPECT acqui-sition of a moving source described analytically (i.e., notvoxelized).

4.1 Loading the SPECT benchmark package

The macro of the SPECT benchmark and the associated programsare available on the CVS at:

/benchmarkSPECT/SPECTbench.mac

4.2 SPECT benchmark: moving source

The gamma camera which is simulated is a gamma camera which does not correspond to anyreal system.

4.2.1 Description of the scanner

The simulated gamma camera is made of four heads at90o each (see Figure 4.1), each with:

- a 2 cm thick lead shielding

- a lead collimator (hole diameter: 0.15 cm, collimator thickness: 3 cm, septal thickness:0.6 mm)

- a 1 cm thick NaI crystal

- a 2.5 cm thick backcompartment in perspex, to roughly modelthe set of photomultipliersand associated electronics.

The head of the camera (i.e. the scanner) called SPECThead is7 cm in thickness, 21 cm inwidth and 30 cm in length.

Part of the macro describing the camera head:

21

Page 26: InstallationGuide_v5.0.0

4.2 SPECT benchmark: moving source

Figure 4.1: Picture of the gamma camera scanner. The red, white, yellow and grey wireframescorrespond to the shielding, the collimator, the crystal and the backcompartment volumes re-spectively.

/gate/world/daughters/name SPECThead/gate/world/daughters/insert box

The gamma camera scanner called SPECThead is created.

/gate/SPECThead/geometry/setXLength 7. cm/gate/SPECThead/geometry/setYLength 21. cm/gate/SPECThead/geometry/setZLength 30. cm

The X, Y and Z dimensions of the gamma camera head are set to 7 cm, 21 cm, and 30 cmrespectively.

/gate/SPECThead/repeaters/insert ring/gate/SPECThead/ring/setRepeatNumber 4

The gamma camera head is repeated four times around the Z axis.

4.2.2 Description of the phantom

The object under investigation is a cylindrical phantom called Phantom (5 cm in diameter and20 cm in length) filled with water and including a cylinder called movsource, which is 2 cmin diameter and 5 cm long and which is filled with Tc-99m (emission energy: 140 keV) (see

- 22 -

Page 27: InstallationGuide_v5.0.0

4.2 SPECT benchmark: moving source

Figure 4.2: Phantom used in the SPECT benchmark. Outside view (left) and inside view (right).

Figure 4.2).

During the acquisition, the phantom moves parallel to the Z axis at 0.04 cm/s.

Part of the macro describing the phantom:

/gate/world/daughters/name Phantom/gate/world/daughters/insert cylinder

The phantom is created.

/gate/Phantom/geometry/setRmax 5. cm/gate/Phantom/geometry/setRmin 0. cm/gate/Phantom/geometry/setHeight 20. cm/gate/Phantom/placement/setTranslation 0. 0. -6. cm

The dimensions and the position of the phantom are defined.

/gate/Phantom/moves/insert translation/gate/Phantom/translation/setSpeed 0 0 0.04 cm/s

The phantom will move at 0.04 cm/s along the Z axis.

4.2.3 Description of the source

The source movement is achieved using confinement (see Chapter VIII of the GATE UsersGuide). Themovsource volume, which has the same dimensions as the source, is required tomodel the source motion. The activity volume has the same diameter as themovsourse volumebut its length is as long as the length of the displacement of themovsource volume. The activityis confined to themovsource volume. The activity of the source is fixed to 30 kBq.

Parts of the macro describing the confinement:

- 23 -

Page 28: InstallationGuide_v5.0.0

4.2 SPECT benchmark: moving source

/gate/Phantom/daughters/name movsource/gate/Phantom/daughters/insert cylinder/gate/movsource/geometry/setRmax 2. cm/gate/movsource/geometry/setRmin 0. cm/gate/movsource/geometry/setHeight 5. cm/gate/movsource/placement/setTranslation 0. 0. -6. cm

Themovsourse volume in which events will be confined is placed in the phantom and willhave the same movement as its mother, namely thePhantom volume.

/gate/source/SourceConfinement/gps/type Volume/gate/source/SourceConfinement/gps/shape Cylinder/gate/source/SourceConfinement/gps/radius 2. cm/gate/source/SourceConfinement/gps/halfz 14.5 cm/gate/source/SourceConfinement/gps/centre 0. 0. 0. cm

The shape, the dimensions and the position of the source are defined.

/gate/source/SourceConfinement/gps/confine movsource_P

The activity is confined to the movsource volume.

4.2.4 Description of the acquisition geometry

The examination table (0.6 cm deep, 8 cm wide and 34 cm long) issimulated. During theacquisition, the table moves together with the phantom (which does not move with respect tothe table), at 0.04 cm/s. (see Figure 4.3).

Figure 4.3: Camera position at t = 0 s (left) and at t = 150 s (right)

- 24 -

Page 29: InstallationGuide_v5.0.0

4.3 Output

4.2.5 Simulation parameters and data processing

Detected events are recorded in the crystal volume. Comptonevents are detected in the phan-tom (phantom andmovsource), in the collimator, in the backcompartment, in the shielding andin the table.The physics processes are modeled using the low energy electromagnetic processes package.Rayleigh, photoelectric and Compton interactions are set on while the gamma conversion in-teractions are set off. To speed up the simulation, thresholds are introduced. The X-rays aretracked until their energy falls under 20 keV. Secondary electrons are not tracked.The digitizer processes the hits recorded by the sensitive detector. The adder module transformshits into pulses. The blurring module simulates a Gaussian energy blurring of FWHM=10% at140 keV. The limited spatial resolution of photomultipliers and associated electronic was sim-ulated using a Gaussian blurring with a standard deviation of 2 mm. A thresholder and anupholder were used to consider only the particles detected with an energy between 20 and 190keV.

Part of the macro describing signal processing:

/gate/digitizer/Singles/insert adder/gate/digitizer/Singles/insert blurring

/gate/digitizer/Singles/blurring/setResolution 0.10/gate/digitizer/Singles/blurring/setEnergyOfReference 140. keV

The blurring module simulates a Gaussian energy blurring ofFWHM=10% at 140 keV.

4.2.6 Description of the acquisition protocol

A SPECT acquisition is simulated, using the SPECThead system. The acquisition consists of64 projections, i.e. 16 projections per head. The heads movealong a circular orbit with a 7cm radius of rotation and a speed of 0.15 degrees per second. Sixteen runs of 37.5 seconds areperformed, to simulate the 16 positions of the 4 gamma cameraheads, yielding 64 projections.Figure 4.4 illustrates the simulated configuration and examples of photon trajectories.Part of the macro describing some "acquisition" parameters:

/gate/application/setTimeSlice 37.5 s/gate/application/setTimeStart 0. s/gate/application/setTimeStop 600. s

setTimeStop-setTimeStartsetTimeSlice = 16 runs of 37.5 seconds are performed.

4.3 Output

The output files of the SPECT benchmark can be analyzed using Cprograms from the ASCIIoutput file or using ROOT from the ROOT output file. The type of ouput files to be created canbe selected with the following commands:

- 25 -

Page 30: InstallationGuide_v5.0.0

4.3 Output

Figure 4.4: Emission of the photons

/gate/output/root/disable/gate/output/ascii/setFileName benchSPECT/gate/output/ascii/setOutFileHitsFlag 0/gate/output/ascii/setOutFileSinglesFlag 1

The ASCII file benchSPECTSingles.dat will be created

/gate/output/ascii/disable/gate/output/root/setFileName benchSPECT/gate/output/root/setRootSinglesFlag 1/gate/output/root/setRootNtupleFlag 1

The ROOT file benchSPECT.root will be created.To get both ASCII and ROOT output files, the macro should contain:

/gate/output/root/setRootSinglesFlag 1/gate/output/root/setRootNtupleFlag 1/gate/output/ascii/setOutFileHitsFlag 0/gate/output/ascii/setOutFileSinglesFlag 1

By default the name of the ASCII file and ROOT output files are gateSingles.dat andgate.root respectively. To change these default names, usethe command setFileName

4.3.1 C programs

Two C programs are provided for processing the ASCII files produced by the macro:

- 26 -

Page 31: InstallationGuide_v5.0.0

4.3 Output

- benchmark_projections.c creates Interfile image files corresponding to the total, scatterand primary photons detected in a 20-190 keV energy range.

- benchmark_spectra.c creates different spectra.

These two C programs have first to be compiled.To run the programs, use:

Executable_name GateSingles.dat

where GateSingles.dat is the name of the file generated when running the benchmark macro.Help regarding the programs can be obtained using:

Executable_name -h

benchmark_projections.c

The program creates raw image files from the ASCII file GateSingles.dat. Three images can becreated:

- Total : image of primary and scattered photons.

- Scatter : image of scattered photons.

- Primary : image of primary photons.

The program is an interactive program and runs as follows:The user is asked for the dimension of the image to be created:

Enter the number of rows and columns of the images to be created

128

Image size is 128 x 128

The user is asked for the lower energy threshold of the imagesto be created:

Enter the lower energy threshold (MeV)

0.02

Lower energy threshold is 0.020000 MeV

The user is asked for the upper energy threshold of the imagesto be created:

Enter the upper energy threshold (MeV)

0.19

Upper energy threshold is 0.190000 MeV

The user is asked for the pixel size of the images to be created:

- 27 -

Page 32: InstallationGuide_v5.0.0

4.3 Output

Enter the size of the pixels (mm)

0.904

Pixels are 0.904 mm x 0.904 mm

The number of projections is predefined and is 64.

Beginning of processingEnd of processing

The program lists the number of detected counts in each image:

Number of events in the image of primary and scattered photons = 17606Number of events in the image of primary photons = 5689Number of events in the image of scattered photons = 11917

The program lists the names of the file corresponding to the images that have been created:

File "Total" corresponds to the image of primary and scattered photonsFile "Primary" corresponds to the image of primary photonsFile "Scatter" corresponds to the image of scattered photons

Output files are Interfile files without header, that is raw data, in short integer coded on 2bytes.

benchmark_spectra.c

The program reads the ASCII file GateSingles.dat and createsspectra.

The program is an interactive program and runs as follows:The user is asked for the lower threshold of the energy spectrum to be created:

Enter the lower energy threshold (MeV)

0.02

Lower energy threshold is 0.020000 MeV

The user is asked for the upper threshold of the energy spectrum to be created:

Enter the upper energy threshold (MeV)

0.19

Upper energy threshold is 0.190000 MeV

The user is asked for the number of energy windows in which theenergy range should besplit:

Enter the number of energy windows

- 28 -

Page 33: InstallationGuide_v5.0.0

4.3 Output

100

Energy range will be divided into 100 energy windows

The user is asked for the number of scattering volumes for which the scatter spectrum shouldbe created. The maximum number of scattering volumes is 10.

Enter the number of scattering volumes to be considered (max is 10)

6

6 scattering volumes will be considered

The user is asked for the first four letters of each scatteringvolume to be considered:

Enter the first four letters of the scattering volume number 1

shie The user chooses shie for shielding

Enter the first four letters of the scattering volume number 2

coll The user chooses coll for collimator

Enter the first four letters of the scattering volume number 3

comp The user chooses comp for compartment

Enter the first four letters of the scattering volume number 4

tabl The user chooses tabl for table

Enter the first four letters of the scattering volume number 5

movs The user chooses movs for movsource

Enter the first four letters of the scattering volume number 6

Phan The user chooses Phan for Phantom

The scattering volumes that will be considered are:shiecollcomptablmovsPhan

Beginning of processing

End of processing

The program lists the names of the files corresponding to eachspectrum that has been cre-ated:

- 29 -

Page 34: InstallationGuide_v5.0.0

4.3 Output

File fich_p corresponds to the primary spectrumFile fich_c corresponds to the photons which have scattered in thecrystalFile fich_t corresponds to the total spectrumFile fich_1 corresponds to the photons whose last scatter interactionwas in the shiel volumeFile fich_2 corresponds to the photons whose last scatter interactionwas in the coll volumeFile fich_3 corresponds to the photons whose last scatter interactionwas in the comp volumeFile fich_4 corresponds to the photons whose last scatter interactionwas in the tabl volumeFile fich_5 corresponds to the photons whose last scatter interactionwas in the movs volumeFile fich_6 corresponds to the photons whose last scatter interactionwas in the Phan volumeFile fich_o1 corresponds to 1st order scatterFile fich_o2 corresponds to 2nd scatter orderFile fich_o3 corresponds to 3rd scatter orderFile fich_o4 corresponds to 4th scatter orderFile fich_o5 corresponds to scatter orders greater than 4

The output files are ASCII files. Each file is made of one column and as many lines as thenumber of energy windows. A line represents the number of detected photons in an energywindow. The generated files can be easily imported in Excel tobe processed.As an example, the total spectrum and the scatter spectra as afunction of the scatter order ofthe detected events are shown in Figure4.5.

4.3.2 ROOT programs

Using ROOT, an analysis program can be applied to the output file benchSPECT.root.

root benchSPECT.root

This command runs the ROOT software and loads the file in the program.

******************************************** W E L C O M E to R O O T ** Version 3.10/02 16 December 2003 ** You are welcome to visit our Web site ** http://root.cern.ch ********************************************

FreeType Engine v2.1.3 used to render TrueType fonts.Compiled for linux with thread support.

CINT/ROOT C/C++ Interpreter version 5.15.115, Dec 9 2003Type ? for help. Commands must be C++ statements.Enclose multiple statements between { }.

- 30 -

Page 35: InstallationGuide_v5.0.0

4.4 Results : SPECT benchmark

Figure 4.5: Total spectrum (top) and scatter spectra as a function of the scatter order (bottom)of the detected events

root [0]Attaching file benchSPECT.root...

In order to execute the same analysis as the benchmark_spectra.c program, the user shouldtype the command:

root [1] .x benchSPECT.C

4.4 Results : SPECT benchmark

The results presented in that section are the compilation ofthe results obtained from elevendifferent computer installations.

4.4.1 Global data

The number of emitted particles is 17999920± 1108 and the total number of detected countsfrom 20 to 190 keV is 35758± 57.

- 31 -

Page 36: InstallationGuide_v5.0.0

4.4 Results : SPECT benchmark

4.4.2 Spectral data

The percentages of primary and scatter photons, as a function of the medium in which the lastscatter event occurred, are presented in Table 4.1.The percentages of scatter photons as a function of the scatter order are presented in Table 4.2.

Primary ScatterPhantom Table Collimator Crystal Backcompartment

36.7 ± 0.1 % 52.5 ± 0.1 % 3.0 ± 0.1 % 0.34 ± 2.9 % 6.1 ± 0.2 % 1.2 ± 3.3 %

Table 4.1: Percentage of primary and scatter photons, as a function of the medium in which thelast scatter event occurred

Scatter order Order 1 Order 2 Order 3 Order 4 Order> 4Number of detected counts (%)49.0 ± 0.2 26.4 ± 0.3 12.8 ± 0.15 6.2 ± 0.1 5.6 ± 0.4

Table 4.2: Percentage of scatter photons as a function of thescatter order

4.4.3 Projection data

• Detected counts per projection

The minimum, maximum, mean and associated standard deviation values of detected countsper projection are (see Figure 4.6) :Min value = 2± 1Max value = 589± 10Mean =278.4± 1.4The Figure 4.6 shows a four-peak pattern. Each peak presentsa bell-shape as the source movesfrom one side of the gamma camera field of view to another: the number of detected counts isthe highest when the source is at the center of the axial field of view, and is the lowest whenthe source is at one edge. As the gamma camera has 4 heads at 90◦ each and because of thesymmetry of the object under consideration, about the same number of counts is detected bythe 4 heads at each position of the source, hence the four-peak pattern.

• Count profile

The 64 projections of the image of primary and scattered photons were summed and all rows ofthe resulting image were summed, yielding the count profile shown in Figure 4.7.The minimum, maximum, mean and associated standard deviation values of the count profile :Min value = 6± 2Max value = 380± 2Mean = 120.6± 1.6

- 32 -

Page 37: InstallationGuide_v5.0.0

4.4 Results : SPECT benchmark

Figure 4.6: Detected counts per projection

Figure 4.7: Count profile through the sum of all projections

4.4.4 Computational data

To get the simulation time automatically in the output of a Gate run, the macro should containthe following command:

/gate/output/verbose 2

Table 4.3 summarizes the PC configurations on which the benchmark was run, the OS,

- 33 -

Page 38: InstallationGuide_v5.0.0

4.4 Results : SPECT benchmark

compiler and software versions used and the corresponding computation time of the SPECTbenchmark macro.

CPU clock OS Version Compiler Geant4 CLHEP Computation time1 GHz RedHat 9.0 gcc 3.2.2 4.5.2 p02 1.8.0.2 11H06

2.6 GHz RedHat 9.0 gcc 3.2.2 4.5.2 1.8.0.2 7H510.8 GHz SuSE 8.1 gcc 3.2 4.5.2 1.8.2.0 6H422.6 GHz SuSE 9.0 gcc 3.3.1 4.5.2 p02 1.8.2.0 5H462.0 GHz RedHat 8.0 gcc 3.2 4.4.1 1.8.0.0 5H211.0 GHz Mac OS X 10.2.8 gcc 3.1 4.5.2 p02 1.8.0.0 5H042.4 GHz RedHat 9.0 gcc 3.2 4.5.1 1.8.0.0 4H332.4 GHz RedHat 7.1 gcc 3.2.2 4.5.2 p02 1.8.0.2 4H161.8 GHz RedHat 7.3 gcc 2.95 4.5.1 1.8.0.0 3H542.8 GHz Fedora Core 1 gcc 3.3.2 4.5.2 p02 1.8.0.2 2H552.0 GHz Fedora Core 4 gcc 4.1 4 9.0 2.0.3.1 1H05

Table 4.3: The PC configuration, OS, compiler and software versions and the computation timeneeded for running the SPECT benchmark macro from ten computer installations.

- 34 -

Page 39: InstallationGuide_v5.0.0

Bibliography

[1] Agostinelli Set al. 2003 GEANT4 - a simulation toolkitNucl. Instr. Meth. A506250-303GEANT4 website: http://geant4.web.cern.ch/geant4/http://geant4.web.cern.ch/geant4/

[2] CLHEP - A Class Library for High Energy Physics : http://proj-clhep.web.cern.ch/proj-clhep/http://proj-clhep.web.cern.ch/proj-clhep/

[3] OpenGL Homepage : http://www.opengl.org/http://www.opengl.org/

[4] DAWN release: http://geant4.kek.jp/ tanaka/http://geant4.kek.jp/ tanaka/

[5] Brun R, Rademakers F 1997 ROOT - An object oriented data analysis frameworkNucl.Instr. Meth. A389 81-86ROOT website: http://root.cern.ch/http://root.cern.ch/

[6] GATE website: http://www.opengatecollaboration.orghttp://www.opengatecollaboration.org

[7] libXML website: http://www.libxml.orghttp://www.libxml.org

35