[Gate-users] No detected counts: pinhole collimator

Michaela Gaens m.gaens at fz-juelich.de
Tue Nov 26 14:36:44 CET 2013


Hi Deborah,

in case you have not found the problem yet: There is just a tiny mistake in your macro: Instead of the line

/run/initialize

you have to use the line

/gate/run/initialize

for the physics initialization. Then you should see data in your output files.

Best regards,
Michaela

On 11/22/2013 01:40 PM, Débora Salvado wrote:
Hi all,

I'm trying to simulate a simple pinhole collimator for a SPECT system. For simplicity, I defined a large aperture, and a point source with only a few counts.
I managed to run the simulation without any errors, but when I open any of the output files, there's nothing in there. No counts at all.
Any suggestions about what might be wrong? You can check the code below. Thanks.

Cheers
Debora Salvado
PhD student, UCL Institute of Nuclear Medicine

--

#############################################
# V I S U A L I S A T I O N
/vis/disable


#################################################
# M A T E R I A L S
# Mandatory load of materials file
/gate/geometry/setMaterialDatabase GateMaterials.db


#################################################
# W O R L D
# Define the world dimensions
/gate/world/geometry/setXLength 1000.0 mm
/gate/world/geometry/setYLength 1000.0 mm
/gate/world/geometry/setZLength 1000.0 mm


#################################################
# S C A N N E R   H E A D
# Create a new box representing the main
# head-volume SPECThead is the name of the
# predefined SPECT system Create the SPECT
# system, which will yield an Interfile output
# of projection data
/gate/world/daughters/name SPECThead
/gate/world/daughters/insert box
# Define the dimensions of the main volume
/gate/SPECThead/geometry/setXLength 300. mm
/gate/SPECThead/geometry/setYLength 300. mm
/gate/SPECThead/geometry/setZLength 300. mm
# Define the position of the main volume
# Move the head x cm away from the Z axis,
# which is the rotation axis and the
# replication axis
/gate/SPECThead/placement/setTranslation  350. 0. 0. mm
/gate/SPECThead/repeaters/insert ring
/gate/SPECThead/ring/setRepeatNumber 4
# Set the material associated with the main volume
/gate/SPECThead/setMaterial Air
/gate/SPECThead/attachPhantomSD
# Define some visualisation options
/gate/SPECThead/vis/forceWireframe

# Shielding
# Create the shielding volume
/gate/SPECThead/daughters/name shielding
/gate/SPECThead/daughters/insert box
# Define the dimensions of the shielding volume
/gate/shielding/geometry/setXLength 300. mm
/gate/shielding/geometry/setYLength 300. mm
/gate/shielding/geometry/setZLength 300. mm
# Define the position of the shielding volume
/gate/shielding/placement/setTranslation  0. 0. 0. mm
# Set the material corresponding to the
# shielding volume
/gate/shielding/setMaterial Lead
# Define some visualisation options
/gate/shielding/vis/setColor red
/gate/shielding/vis/forceWireframe
# Attach phantom SD to record Compton
# interactions in the shielding volume
# Needed to discriminate between scattered
# and unscattered photons
/gate/shielding/attachPhantomSD


#################################################
# C O L L I M A T O R
# Create a full volume defining the shape
# of the collimator
/gate/SPECThead/daughters/name collimator
/gate/SPECThead/daughters/insert box
/gate/collimator/geometry/setXLength 20. mm
/gate/collimator/geometry/setYLength 300. mm
/gate/collimator/geometry/setZLength 300. mm
/gate/collimator/setMaterial Lead
/gate/collimator/placement/setTranslation -140. 0. 0. mm
/gate/collimator/vis/forceWireframe
/gate/collimator/vis/setColor red
# Attach PhantomSD to record Compton
# interactions in the collimator volume
/gate/collimator/attachPhantomSD


#################################################
# P I N H O L E
# Insert the pinhole in the collimator
/gate/collimator/daughters/name hole
/gate/collimator/daughters/insert cylinder
/gate/hole/geometry/setHeight 20. mm
/gate/hole/geometry/setRmax 10. mm
/gate/hole/placement/alignToX
/gate/hole/setMaterial Air
/gate/hole/vis/forceSolid

/gate/collimator/daughters/name cone1
/gate/collimator/daughters/insert cone
/gate/cone1/geometry/setHeight 10. mm
/gate/cone1/geometry/setRmin1 0. mm
/gate/cone1/geometry/setRmax1 30. mm
/gate/cone1/geometry/setRmin2 0. mm
/gate/cone1/geometry/setRmax2 10. mm
/gate/cone1/placement/setTranslation -5. 0. 0. mm
/gate/cone1/placement/alignToX
/gate/cone1/setMaterial Air
/gate/cone1/vis/forceSolid

/gate/collimator/daughters/name cone2
/gate/collimator/daughters/insert cone
/gate/cone2/geometry/setHeight 10. mm
/gate/cone2/geometry/setRmin1 0. mm
/gate/cone2/geometry/setRmax1 10. mm
/gate/cone2/geometry/setRmin2 0. mm
/gate/cone2/geometry/setRmax2 30. mm
/gate/cone2/placement/setTranslation 5. 0. 0. mm
/gate/cone2/placement/alignToX
/gate/cone2/setMaterial Air
/gate/cone2/vis/forceSolid


#################################################
# C A M  H E A D  A I R
# insert air behind the collimator
/gate/SPECThead/daughters/name aircomp
/gate/SPECThead/daughters/insert box
/gate/aircomp/geometry/setXLength 70. mm
/gate/aircomp/geometry/setYLength 260. mm
/gate/aircomp/geometry/setZLength 260. mm
/gate/aircomp/placement/setTranslation -95. 0. 0. mm
/gate/aircomp/vis/forceWireframe
/gate/aircomp/setMaterial Air


#################################################
# C R Y S T A L
# Create the crystal volume
/gate/SPECThead/daughters/name crystal
/gate/SPECThead/daughters/insert box
# Define the dimensions of the crystal volume
/gate/crystal/geometry/setXLength  26. mm
/gate/crystal/geometry/setYLength 260. mm
/gate/crystal/geometry/setZLength 260. mm
# Define the position of the crystal volume
/gate/crystal/placement/setTranslation  -47. 0. 0. mm
# Set the material associated with the crystal
# volume
/gate/crystal/setMaterial NaI
# Define some visualisation options
/gate/crystal/vis/setColor yellow
# The crystal SD makes it possible to
# record hits in a sensitive volume
/gate/crystal/attachCrystalSD


#################################################
# B A C K - C O M P A R T M E N T
# Create the back-compartment volume
/gate/SPECThead/daughters/name compartment
/gate/SPECThead/daughters/insert box
# Define the dimensions of the back-compartment volume
/gate/compartment/geometry/setXLength  40. mm
/gate/compartment/geometry/setYLength 260. mm
/gate/compartment/geometry/setZLength 260. mm
# Define the position of the back-compartment volume
/gate/compartment/placement/setTranslation -14. 0. 0. mm
# Set the material of the  back-compartment volume
/gate/compartment/setMaterial Glass
# Define some visualisation options
/gate/compartment/vis/setColor grey
# Attach PhantomSD to record Compton
# interactions in the back-compartment volume
/gate/compartment/attachPhantomSD


#################################################
# P H A N T O M
# Create the phantom volume
/gate/world/daughters/name Phantom
/gate/world/daughters/insert sphere
# Define the dimensions of the phantom
# volume
/gate/Phantom/geometry/setRmax 0.01 cm
/gate/Phantom/geometry/setRmin 0. mm
/gate/Phantom/placement/setTranslation 0. 0. 0. mm
# Set the material corresponding to the
# phantom volume
/gate/Phantom/setMaterial Water
# Define some visualisation options
/gate/Phantom/vis/setColor blue
/gate/Phantom/vis/forceWireframe
# Attach PhantomSD to record Compton
# interactions in the phantom volume
# This can provide information
# for result analysis to discriminate between
# scattered and unscattered photons.
/gate/Phantom/attachPhantomSD


#################################################
# SENSITIVE DETECTORS
# GATE provides two sensitive detectors,
# which have two different functions
# Using them properly is very important
# for getting accurate results.


#################################################
# S Y S T E M
# The system acts as an interpretor between
# the GATE geometry and data outputs for
# reconstruction in our case, the Interfile
# writer. A system must know which components
# of the geometry are parts of the scanner,
# and what their role are. For the moment,
# there is only a system SPECThead, which
# was built when the SPECThead volume was
# inserted.
# The SPECThead system is made of three
# levels: base (for the head), crystal (for
# the crystal and crystal matrix) and pixel
# (for individual crystals for pixellated
# gamma camera) For now, only the base of
# the system is attached to a volume: the
# volume SPECThead. For the system to get
# information about your crystal, the level
# crystal must be attached to the volume that
# has been defined for the scintillating
# crystal (crystal)
/gate/systems/SPECThead/crystal/attach crystal
# Look at the system
/gate/systems/SPECThead/describe


#################################################
# P H Y S I C S
/gate/physics/addProcess PhotoElectric
/gate/physics/processes/PhotoElectric/setModel StandardModel
/gate/physics/addProcess Compton
/gate/physics/processes/Compton/setModel PenelopeModel
/gate/physics/addProcess RayleighScattering
/gate/physics/processes/RayleighScattering/setModel PenelopeModel
/gate/physics/addProcess ElectronIonisation
/gate/physics/processes/ElectronIonisation/setModel StandardModel e-
/gate/physics/addProcess Bremsstrahlung
/gate/physics/processes/Bremsstrahlung/setModel StandardModel e-
/gate/physics/addProcess MultipleScattering e-
/gate/physics/processList Enabled
/gate/physics/processList Initialized


#################################################
# C U T S
# Cuts for particle in WORLD
/gate/physics/Gamma/SetCutInRegion      SPECThead 0.1 cm
/gate/physics/Electron/SetCutInRegion   SPECThead 1.0 cm

# Physics initialization
/run/initialize


#################################################
# S O U R C E
# Setting up the source
/gate/source/addSource SourceConfinement
# Define the shape of the source
/gate/source/SourceConfinement/gps/type Volume
/gate/source/SourceConfinement/gps/shape Sphere
# Define the dimensions of the source
/gate/source/SourceConfinement/gps/radius 0.01 cm
# Define the placement of the source
/gate/source/SourceConfinement/gps/centre 0. 0. 0. mm
# Define the source as a gamma source
/gate/source/SourceConfinement/gps/particle gamma
# Define the gamma energy
/gate/source/SourceConfinement/gps/energy 140. keV
# Set the activity of the source
/gate/source/SourceConfinement/setActivity 8000. Bq
# Define the emission direction (4 str)
/gate/source/SourceConfinement/gps/angtype iso


#################################################
# D I G I T I Z E R
# The digitizer tracks what happens in the
# detection system and in the electronics
# Build a digitizer that first computes the
# centroid of interactions
/gate/digitizer/Singles/insert adder
/gate/digitizer/Singles/insert blurring
/gate/digitizer/Singles/blurring/setResolution 0.15
/gate/digitizer/Singles/blurring/setEnergyOfReference 140. keV
/gate/digitizer/Singles/insert spblurring
/gate/digitizer/Singles/spblurring/setSpresolution 10.0 mm
/gate/digitizer/Singles/spblurring/verbose 0
/gate/digitizer/Singles/insert thresholder
/gate/digitizer/Singles/thresholder/setThreshold 20. keV
/gate/digitizer/Singles/insert upholder
/gate/digitizer/Singles/upholder/setUphold 190. keV


#################################################
# O U T P U T
# Select the options of the data output
# As there are several modules, settings have
# to be defined for each module, especially in
# SPECT, where there are a lots of hits for
# only a few counts, so it's better to limit
# the amount of data produced Here the
# SingleDigi output can be used if you have
# your own program to process the data
/gate/output/root/enable
/gate/output/root/setFileName pinholeSPECT
/gate/output/root/setRootHitFlag 1
/gate/output/root/setRootSinglesAdderFlag 1
/gate/output/root/setRootSinglesBlurringFlag 1
/gate/output/root/setRootSinglesSpblurringFlag 1
/gate/output/root/setRootSinglesThresholderFlag 1
/gate/output/root/setRootSinglesUpholderFlag 1

/gate/output/ascii/enable
/gate/output/ascii/setFileName test
/gate/output/ascii/setOutFileHitsFlag 1
/gate/output/ascii/setOutFileSinglesFlag 1
/gate/output/ascii/setOutFileSinglesAdderFlag 0
/gate/output/ascii/setOutFileSinglesSpblurringFlag 0
/gate/output/ascii/setOutFileSinglesBlurringFlag 0
/gate/output/ascii/setOutFileSinglesThresholderFlag 0
/gate/output/ascii/setOutFileSinglesUpholderFlag 0


#################################################
# R A N D O M
# Change the root of the random module to run different simulations
/gate/random/setEngineName Ranlux64
/gate/random/setEngineSeed 123456789
/gate/random/verbose 1


#################################################
# P R O J E C T I O N
# Makes a set of projections from the crystal
# hits Define the binning the projection module
# to be used
/gate/output/projection/enable
/gate/output/projection/setFileName gate
/gate/output/projection/pixelSizeX 2.03125 mm
/gate/output/projection/pixelSizeY  2.03125 mm
/gate/output/projection/pixelNumberX 128
/gate/output/projection/pixelNumberY 128
# Specify the projection plane (XY, YZ or ZX)
/gate/output/projection/projectionPlane YZ


#################################################
# E X P E R I M E N T
# Define the parameters of the experiment
# (start time, stop time and time slice)
# The number of projections depends on the
# number of time slice, the rotation speed of
# the system and the number of heads
/gate/application/setTimeSlice       240.  s
/gate/application/setTimeStart        0.  s
/gate/application/setTimeStop        240.  s


#################################################
# V E R B O S I T Y
/control/verbose 0
/run/verbose 0
/event/verbose 0
/tracking/verbose 0


#################################################
# L E T ' S  R U N  T H E  S I M U L A T I O N  !
/gate/application/startDAQ



_______________________________________________
Gate-users mailing list
Gate-users at lists.opengatecollaboration.org<mailto:Gate-users at lists.opengatecollaboration.org>
http://lists.opengatecollaboration.org/mailman/listinfo/gate-users



------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opengatecollaboration.org/mailman/private/gate-users/attachments/20131126/cd506c50/attachment-0001.html>


More information about the Gate-users mailing list