0% found this document useful (0 votes)
6 views5 pages

Simulations With Gate Hands-On: Installation

The document provides a detailed guide for installing and using the GATE simulation software, specifically version 8.1, for conducting simulations related to radiation safety. It includes instructions for setting up the environment, creating a material database, constructing geometry, and launching simulations with various particle sources. Additionally, it covers the use of the actor tool for recording simulation data and analyzing results from CT scans.

Uploaded by

sophiawong105
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views5 pages

Simulations With Gate Hands-On: Installation

The document provides a detailed guide for installing and using the GATE simulation software, specifically version 8.1, for conducting simulations related to radiation safety. It includes instructions for setting up the environment, creating a material database, constructing geometry, and launching simulations with various particle sources. Additionally, it covers the use of the actor tool for recording simulation data and analyzing results from CT scans.

Uploaded by

sophiawong105
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Simulations with Gate

Hands-on
Thomas Carlier & Ludovic Ferrer
4 juin 2019

Installation
Please, refer to wiki pages at wiki.opengatecolaboration.org. Installation process should
be quite straight forward (unless you decide to install gate on windows system). During this
lecture, you are going to use gate8.1. First step, initialize all the environment variables by
sourcing an environment file :
prompt> source /home/info/cussonno/geant4.10.04.p02/env-geant4.10.04.p02-Gate_V8.1-gcc4.9.2.csh

We provided you with a list of macro files needed for executing a basic simulation with gate.
Put those files in a directory of your choice, this directory will be your working directory and
go down to this working directory.
prompt> cd myworkingdirectory

Launch gatein a terminal to enter interactive commands. If all went well, you should end with
the following lines in your terminal :
[G4] **************************************************************
[G4] Geant4 version Name: geant4-10-04-patch-02 (25-May-2018)
[G4] Copyright : Geant4 Collaboration
[G4] References : NIM A 506 (2003), 250-303
[G4] : IEEE-TNS 53 (2006), 270-278
[G4] : NIM A 835 (2016), 186-225
[G4] WWW : http://geant4.org/
[G4] **************************************************************
[G4]
[Core-0] Initialization of geometry
[Core-0] Initialization of physics
[Core-0] Initialization of actors
[Core-0]
[Core-0] *************************************************
[Core-0] GATE version 8.1.p01 (April 2018)
[Core-0] Copyright : OpenGATE Collaboration
[Core-0] Reference : Phys. Med. Biol. 49 (2004) 4543-4561
[Core-0] Reference : Phys. Med. Biol. 56 (2011) 881-901
[Core-0] Reference : Med. Phys. 41(6) (2014)
[Core-0] http://www.opengatecollaboration.org
[Core-0] *************************************************
[Core-0]
[Core-0] You are using Geant4 version 10.4.2
PreInit>

Assuming that there is a macro file called main.mac in your working directory, execute gateby
typing at the gate prompt :
Idle>/control/execute main.mac
Last output lines should be very similar to :

1
========= Table of registered couples ==============================

Index : 0 used in the geometry : Yes recalculation needed : No


Material : Air
Range cuts : gamma 1 mm e- 1 mm e+ 1 mm proton 1 mm
Energy thresholds : gamma 250 eV e- 336.229 eV e+ 333.259 eV proton 100 keV
Region(s) which use this couple :
DefaultRegionForTheWorld

Index : 1 used in the geometry : Yes recalculation needed : No


Material : Lead
Range cuts : gamma 1 mm e- 1 mm e+ 1 mm proton 1 mm
Energy thresholds : gamma 102.04 keV e- 1.36653 MeV e+ 1.28908 MeV proton 100 keV
Region(s) which use this couple :
enceinte

Index : 2 used in the geometry : Yes recalculation needed : No


Material : Lead
Range cuts : gamma 1 mm e- 1 mm e+ 1 mm proton 1 mm
Energy thresholds : gamma 102.04 keV e- 1.36653 MeV e+ 1.28908 MeV proton 100 keV
Region(s) which use this couple :
insideEnceinte

Index : 3 used in the geometry : Yes recalculation needed : No


Material : Glass
Range cuts : gamma 1 mm e- 1 mm e+ 1 mm proton 1 mm
Energy thresholds : gamma 5.67075 keV e- 590.683 keV e+ 569.53 keV proton 100 keV
Region(s) which use this couple :
vial

Index : 4 used in the geometry : Yes recalculation needed : No


Material : Water
Range cuts : gamma 1 mm e- 1 mm e+ 1 mm proton 1 mm
Energy thresholds : gamma 2.94146 keV e- 351.933 keV e+ 341.814 keV proton 100 keV
Region(s) which use this couple :
iodineSolution

Index : 5 used in the geometry : Yes recalculation needed : No


Material : Air
Range cuts : gamma 1 mm e- 1 mm e+ 1 mm proton 1 mm
Energy thresholds : gamma 250 eV e- 336.229 eV e+ 333.259 eV proton 100 keV
Region(s) which use this couple :
airInVial

====================================================================

This summarizes the production cut in range (and consequently in energy) for each region you
defined in your simulation. Pay attention that those values represent production cuts : secondary
particles are generated if their energy are sufficient to move themself farther than the range cut.
Otherwise, energy is locally deposited. In this example, all particles in each region have 1 mm
range cut.

1 Part One : Geometry construction


In this section, you are asked to build a simple simulation in order to evaluate different
screening materials. This kind of simulation could be useful for example radiation safety purposes.

1.1 Material database


In this section, you are asked to create a new material into the material database named
GateMaterials.db. You are encouraged to create your own database by ”copy-pasting” the
provided one and to modify the ”pasted” database.
Create a new material LeadGlass (ρ = 3.7g/cm2 ) which is made of :
— Sodium, fraction of mass : 0.055
— Calcium, fraction of mass : 0.027
— Silicon, fraction of mass : 0.134
— Oxygen, fraction of mass : 0.553
— Lead, fraction of mass : 0.231

2
1.2 Geometry setup
The setup consists of a cubic (30cmx30cmx30cm) cabinet with walls made of lead (0.5cm
thick). Inside, one lay a vial (diameter : 2cm height : 4cm wall thickness : 0.2 cm material : glass)
contening a water solution (2 cm height).

1.2.1 Cabinet
Create and position imbricated boxes into world with correct dimensions.

1.2.2 Glass vial


Create and position a glass cylinder into the cabinet with correct dimensions.

1.2.3 Water solution


Create and position a water cylinder into the glass vial with correct dimensions.

1.2.4 Seeing window frame : Optional


Try to insert a window frame inside one of the cabinet wall (choose the dimension you’d like).
This window should be made of lead glass (the material you created beforehand).

1.3 Checking your geometry


If you want to check that volumes don’t intersect each other, you could verify your geometry
setup. First, comment the last line of mainpart1.mac macrofile. 1

/run/application/startDAQ
Launch gatein interactive mode and enter the following command at gate prompt :
Idle>/geometry/test/recursive_test

2 Part Two : Primaries


This section is intended to show you how to create primaries/particles.

In your working directory, the file sourceMono.mac contains the definition of a mono-
energetic (1 MeV) gamma point source. Modify the file in order to transform the point source
as a cylindrical volume source with the same dimensions as the water cylinder defined in § 1.2.3.

Create a new file in your working directory and try to create an iodine-131 source in the same
geometrical configuration as the previous point. Use ion type source.
In your working directory, modify the file main.mac according to :
/tracking/verbose 1
1. Use # character to comment lines.

3
Launching your first simulation. This simulation consists of monoenergetic electron point
source (5 particles) firing in all direction inside the geometry just defined. In your terminal
window, go to your working directory and launch your simulation.
prompt>gate mainpart1.mac
*********************************************************************************************************
* G4Track Information: Particle = e-, Track ID = 1, Parent ID = 0
*********************************************************************************************************

Step# X(mm) Y(mm) Z(mm) KinE(MeV) dE(MeV) StepLeng TrackLeng NextVolume ProcName
0 0 0 -140 1 0 0 0 iodineSolution_phys initStep
1 1.48 0.383 -139 0.608 0.392 2.29 2.29 iodineSolution_phys ElectronIonisation
2 2.38 0.0424 -139 0.265 0.343 1.71 4 iodineSolution_phys ElectronIonisation
3 2.37 0.0414 -140 0 0.265 0.689 4.69 iodineSolution_phys ElectronIonisation

*********************************************************************************************************
* G4Track Information: Particle = e-, Track ID = 1, Parent ID = 0
*********************************************************************************************************

Step# X(mm) Y(mm) Z(mm) KinE(MeV) dE(MeV) StepLeng TrackLeng NextVolume ProcName
0 0 0 -140 1 0 0 0 iodineSolution_phys initStep
1 -1.37 0.531 -142 0.442 0.558 2.29 2.29 iodineSolution_phys ElectronIonisation
2 -2.05 0.385 -142 0 0.442 1.35 3.64 iodineSolution_phys ElectronIonisation

*********************************************************************************************************
* G4Track Information: Particle = e-, Track ID = 1, Parent ID = 0
*********************************************************************************************************

Step# X(mm) Y(mm) Z(mm) KinE(MeV) dE(MeV) StepLeng TrackLeng NextVolume ProcName
0 0 0 -140 1 0 0 0 iodineSolution_phys initStep
1 -1.32 -0.918 -139 0.571 0.429 2.29 2.29 iodineSolution_phys ElectronIonisation
2 -2.06 -1.56 -140 0 0.571 1.64 3.93 iodineSolution_phys ElectronIonisation

*********************************************************************************************************
* G4Track Information: Particle = e-, Track ID = 1, Parent ID = 0
*********************************************************************************************************

Step# X(mm) Y(mm) Z(mm) KinE(MeV) dE(MeV) StepLeng TrackLeng NextVolume ProcName
0 0 0 -140 1 0 0 0 iodineSolution_phys initStep
1 1.17 0.423 -138 0.655 0.345 2.29 2.29 iodineSolution_phys ElectronIonisation
2 1.47 0.0559 -137 0.301 0.354 1.79 4.08 iodineSolution_phys ElectronIonisation
3 1.78 -0.245 -136 0 0.301 0.838 4.92 iodineSolution_phys ElectronIonisation

*********************************************************************************************************
* G4Track Information: Particle = e-, Track ID = 1, Parent ID = 0
*********************************************************************************************************

Step# X(mm) Y(mm) Z(mm) KinE(MeV) dE(MeV) StepLeng TrackLeng NextVolume ProcName
0 0 0 -140 1 0 0 0 iodineSolution_phys initStep
1 -2.03 -0.863 -140 0.585 0.415 2.29 2.29 iodineSolution_phys ElectronIonisation
2 -2.64 -0.598 -142 0.235 0.351 1.67 3.96 iodineSolution_phys ElectronIonisation
3 -2.49 -0.826 -142 0 0.235 0.573 4.53 iodineSolution_phys ElectronIonisation

In your terminal, you should end up with lines very similar to those above. Could you explain/-
comment, please ?

Playing with cuts : Add the following line at the end of your ”geometry” macrofile and
modify it accordingly.
/gate/physics/Electron/SetCutInRegion nameofYOURIodineSolution 2 um
This will define a new range cut for electron in the region named nameofYOURIodineSolution.
Relaunch gateand comment the differences with the previous output.

Playing with particles : Change particle type to gamma and energy to 140 keV. Comment
the electromagnetic shower. Modify electron cut range in regions that matter in order to knock
on secondary particles. Comment this new electromagnetic shower.

3 Part 3 : A useful tool to record information in gate


The aim of this section is to learn how the actor tool available in gateworks. The actor tool
can collect information during the simulation, such as energy deposit, number of particles created

4
or dose. They can be applied and managed within a specified volume.
In this section, we are using a "realistic" object. The input data is a CT scan (voxelised object).
For clarity purpose, the CT scan is labelled and only few organs are available.
1. Open the CT scan with ImageJ 2 .
2. A complete set of macro files are provided in the directory "Part 3". Open the file
mainMacroTP_P.mac and remove all the comments following the sentence "Just for vi-
zualisation purpose". Comment all the line following the sentence "For dose output". Run
the macro with GATE and comment.
3. Remove (or comment) all the lines related to the previous question concerning the vizua-
lisation. Remove the comments for the dose output. Run again the simulation. A set of
files are now created in the directory "output". Open each file ending with the extension
".img" with ImageJ. 3 Explain the results.
4. Change the beam using photons with an initial energy of 18 MeV (σ = 1 MeV). Run the
simulation and explain again the results.
5. Same question by using an electron beam with an initial energy of 20 MeV (σ = 1 MeV).
6. The objective is now to use again the proton beam and to correctly target the spine
bone. Find (and demonstrate that your solution is correct) a method where the maximum
energy is deposited in the spine bone.

2. Data are encoded in unsigned integer and the image size is 128×128 × 204.
3. Data are encoded in 32-bits real and the image size is 128 × 128 × 204.

You might also like