<div dir="ltr"><div><div>Hi all,<br><br></div>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.<br></div>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.<br>
Any suggestions about what might be wrong? You can check the code below. Thanks.<br><br clear="all"><div><div><div><div>Cheers<br>Debora Salvado<br></div><div>PhD student, UCL Institute of Nuclear Medicine<br><br>--<br><br>
#############################################<br># V I S U A L I S A T I O N<br>/vis/disable<br><br><br>#################################################<br># M A T E R I A L S<br># Mandatory load of materials file<br>/gate/geometry/setMaterialDatabase GateMaterials.db<br>
<br><br>#################################################<br># W O R L D<br># Define the world dimensions<br>/gate/world/geometry/setXLength 1000.0 mm<br>/gate/world/geometry/setYLength 1000.0 mm <br>/gate/world/geometry/setZLength 1000.0 mm<br>
<br><br>#################################################<br># S C A N N E R H E A D <br># Create a new box representing the main <br># head-volume SPECThead is the name of the <br># predefined SPECT system Create the SPECT <br>
# system, which will yield an Interfile output <br># of projection data<br>/gate/world/daughters/name SPECThead<br>/gate/world/daughters/insert box<br># Define the dimensions of the main volume <br>/gate/SPECThead/geometry/setXLength 300. mm<br>
/gate/SPECThead/geometry/setYLength 300. mm<br>/gate/SPECThead/geometry/setZLength 300. mm<br># Define the position of the main volume<br># Move the head x cm away from the Z axis, <br># which is the rotation axis and the <br>
# replication axis<br>/gate/SPECThead/placement/setTranslation 350. 0. 0. mm<br>/gate/SPECThead/repeaters/insert ring <br>/gate/SPECThead/ring/setRepeatNumber 4<br># Set the material associated with the main volume<br>
/gate/SPECThead/setMaterial Air<br>/gate/SPECThead/attachPhantomSD<br># Define some visualisation options<br>/gate/SPECThead/vis/forceWireframe<br><br># Shielding<br># Create the shielding volume<br>/gate/SPECThead/daughters/name shielding <br>
/gate/SPECThead/daughters/insert box<br># Define the dimensions of the shielding volume<br>/gate/shielding/geometry/setXLength 300. mm<br>/gate/shielding/geometry/setYLength 300. mm<br>/gate/shielding/geometry/setZLength 300. mm <br>
# Define the position of the shielding volume<br>/gate/shielding/placement/setTranslation 0. 0. 0. mm<br># Set the material corresponding to the <br># shielding volume<br>/gate/shielding/setMaterial Lead<br># Define some visualisation options<br>
/gate/shielding/vis/setColor red<br>/gate/shielding/vis/forceWireframe<br># Attach phantom SD to record Compton <br># interactions in the shielding volume<br># Needed to discriminate between scattered <br># and unscattered photons<br>
/gate/shielding/attachPhantomSD<br><br><br>#################################################<br># C O L L I M A T O R<br># Create a full volume defining the shape <br># of the collimator<br>/gate/SPECThead/daughters/name collimator <br>
/gate/SPECThead/daughters/insert box<br>/gate/collimator/geometry/setXLength 20. mm <br>/gate/collimator/geometry/setYLength 300. mm <br>/gate/collimator/geometry/setZLength 300. mm <br>/gate/collimator/setMaterial Lead <br>
/gate/collimator/placement/setTranslation -140. 0. 0. mm<br>/gate/collimator/vis/forceWireframe<br>/gate/collimator/vis/setColor red<br># Attach PhantomSD to record Compton <br># interactions in the collimator volume <br>
/gate/collimator/attachPhantomSD<br><br><br>#################################################<br># P I N H O L E<br># Insert the pinhole in the collimator<br>/gate/collimator/daughters/name hole<br>/gate/collimator/daughters/insert cylinder <br>
/gate/hole/geometry/setHeight 20. mm<br>/gate/hole/geometry/setRmax 10. mm <br>/gate/hole/placement/alignToX<br>/gate/hole/setMaterial Air<br>/gate/hole/vis/forceSolid<br><br>/gate/collimator/daughters/name cone1<br>/gate/collimator/daughters/insert cone <br>
/gate/cone1/geometry/setHeight 10. mm<br>/gate/cone1/geometry/setRmin1 0. mm<br>/gate/cone1/geometry/setRmax1 30. mm<br>/gate/cone1/geometry/setRmin2 0. mm<br>/gate/cone1/geometry/setRmax2 10. mm<br>/gate/cone1/placement/setTranslation -5. 0. 0. mm<br>
/gate/cone1/placement/alignToX<br>/gate/cone1/setMaterial Air<br>/gate/cone1/vis/forceSolid<br><br>/gate/collimator/daughters/name cone2<br>/gate/collimator/daughters/insert cone<br>/gate/cone2/geometry/setHeight 10. mm<br>
/gate/cone2/geometry/setRmin1 0. mm<br>/gate/cone2/geometry/setRmax1 10. mm<br>/gate/cone2/geometry/setRmin2 0. mm<br>/gate/cone2/geometry/setRmax2 30. mm<br>/gate/cone2/placement/setTranslation 5. 0. 0. mm<br>/gate/cone2/placement/alignToX<br>
/gate/cone2/setMaterial Air<br>/gate/cone2/vis/forceSolid<br><br><br>#################################################<br># C A M H E A D A I R<br># insert air behind the collimator<br>/gate/SPECThead/daughters/name aircomp<br>
/gate/SPECThead/daughters/insert box<br>/gate/aircomp/geometry/setXLength 70. mm <br>/gate/aircomp/geometry/setYLength 260. mm<br>/gate/aircomp/geometry/setZLength 260. mm<br>/gate/aircomp/placement/setTranslation -95. 0. 0. mm<br>
/gate/aircomp/vis/forceWireframe<br>/gate/aircomp/setMaterial Air<br><br><br>#################################################<br># C R Y S T A L<br># Create the crystal volume<br>/gate/SPECThead/daughters/name crystal<br>
/gate/SPECThead/daughters/insert box<br># Define the dimensions of the crystal volume<br>/gate/crystal/geometry/setXLength 26. mm <br>/gate/crystal/geometry/setYLength 260. mm<br>/gate/crystal/geometry/setZLength 260. mm<br>
# Define the position of the crystal volume <br>/gate/crystal/placement/setTranslation -47. 0. 0. mm <br># Set the material associated with the crystal <br># volume<br>/gate/crystal/setMaterial NaI<br># Define some visualisation options<br>
/gate/crystal/vis/setColor yellow<br># The crystal SD makes it possible to <br># record hits in a sensitive volume <br>/gate/crystal/attachCrystalSD <br><br><br>#################################################<br># B A C K - C O M P A R T M E N T<br>
# Create the back-compartment volume<br>/gate/SPECThead/daughters/name compartment<br>/gate/SPECThead/daughters/insert box<br># Define the dimensions of the back-compartment volume<br>/gate/compartment/geometry/setXLength 40. mm<br>
/gate/compartment/geometry/setYLength 260. mm<br>/gate/compartment/geometry/setZLength 260. mm<br># Define the position of the back-compartment volume <br>/gate/compartment/placement/setTranslation -14. 0. 0. mm<br># Set the material of the back-compartment volume<br>
/gate/compartment/setMaterial Glass<br># Define some visualisation options<br>/gate/compartment/vis/setColor grey <br># Attach PhantomSD to record Compton <br># interactions in the back-compartment volume<br>/gate/compartment/attachPhantomSD<br>
<br><br>#################################################<br># P H A N T O M<br># Create the phantom volume <br>/gate/world/daughters/name Phantom<br>/gate/world/daughters/insert sphere<br># Define the dimensions of the phantom <br>
# volume<br>/gate/Phantom/geometry/setRmax 0.01 cm<br>/gate/Phantom/geometry/setRmin 0. mm<br>/gate/Phantom/placement/setTranslation 0. 0. 0. mm<br># Set the material corresponding to the <br># phantom volume<br>/gate/Phantom/setMaterial Water<br>
# Define some visualisation options <br>/gate/Phantom/vis/setColor blue<br>/gate/Phantom/vis/forceWireframe <br># Attach PhantomSD to record Compton<br># interactions in the phantom volume<br># This can provide information <br>
# for result analysis to discriminate between <br># scattered and unscattered photons.<br>/gate/Phantom/attachPhantomSD<br><br><br>#################################################<br># SENSITIVE DETECTORS<br># GATE provides two sensitive detectors, <br>
# which have two different functions<br># Using them properly is very important <br># for getting accurate results.<br><br><br>#################################################<br># S Y S T E M<br># The system acts as an interpretor between <br>
# the GATE geometry and data outputs for <br># reconstruction in our case, the Interfile <br># writer. A system must know which components <br># of the geometry are parts of the scanner, <br># and what their role are. For the moment, <br>
# there is only a system SPECThead, which <br># was built when the SPECThead volume was<br># inserted. <br># The SPECThead system is made of three <br># levels: base (for the head), crystal (for <br># the crystal and crystal matrix) and pixel <br>
# (for individual crystals for pixellated <br># gamma camera) For now, only the base of <br># the system is attached to a volume: the <br># volume SPECThead. For the system to get<br># information about your crystal, the level <br>
# crystal must be attached to the volume that <br># has been defined for the scintillating <br># crystal (crystal) <br>/gate/systems/SPECThead/crystal/attach crystal<br># Look at the system<br>/gate/systems/SPECThead/describe <br>
<br><br>#################################################<br># P H Y S I C S<br>/gate/physics/addProcess PhotoElectric<br>/gate/physics/processes/PhotoElectric/setModel StandardModel<br>/gate/physics/addProcess Compton<br>
/gate/physics/processes/Compton/setModel PenelopeModel<br>/gate/physics/addProcess RayleighScattering<br>/gate/physics/processes/RayleighScattering/setModel PenelopeModel<br>/gate/physics/addProcess ElectronIonisation<br>
/gate/physics/processes/ElectronIonisation/setModel StandardModel e-<br>/gate/physics/addProcess Bremsstrahlung<br>/gate/physics/processes/Bremsstrahlung/setModel StandardModel e-<br>/gate/physics/addProcess MultipleScattering e-<br>
/gate/physics/processList Enabled<br>/gate/physics/processList Initialized<br><br><br>#################################################<br># C U T S<br># Cuts for particle in WORLD<br>/gate/physics/Gamma/SetCutInRegion SPECThead 0.1 cm<br>
/gate/physics/Electron/SetCutInRegion SPECThead 1.0 cm<br><br># Physics initialization<br>/run/initialize<br><br><br>#################################################<br># S O U R C E<br># Setting up the source<br>/gate/source/addSource SourceConfinement<br>
# Define the shape of the source<br>/gate/source/SourceConfinement/gps/type Volume<br>/gate/source/SourceConfinement/gps/shape Sphere<br># Define the dimensions of the source<br>/gate/source/SourceConfinement/gps/radius 0.01 cm<br>
# Define the placement of the source<br>/gate/source/SourceConfinement/gps/centre 0. 0. 0. mm <br># Define the source as a gamma source<br>/gate/source/SourceConfinement/gps/particle gamma<br># Define the gamma energy <br>
/gate/source/SourceConfinement/gps/energy 140. keV <br># Set the activity of the source<br>/gate/source/SourceConfinement/setActivity 8000. Bq<br># Define the emission direction (4 str)<br>/gate/source/SourceConfinement/gps/angtype iso<br>
<br><br>#################################################<br># D I G I T I Z E R<br># The digitizer tracks what happens in the <br># detection system and in the electronics<br># Build a digitizer that first computes the <br>
# centroid of interactions<br>/gate/digitizer/Singles/insert adder<br>/gate/digitizer/Singles/insert blurring<br>/gate/digitizer/Singles/blurring/setResolution 0.15<br>/gate/digitizer/Singles/blurring/setEnergyOfReference 140. keV <br>
/gate/digitizer/Singles/insert spblurring<br>/gate/digitizer/Singles/spblurring/setSpresolution 10.0 mm<br>/gate/digitizer/Singles/spblurring/verbose 0<br>/gate/digitizer/Singles/insert thresholder<br>/gate/digitizer/Singles/thresholder/setThreshold 20. keV <br>
/gate/digitizer/Singles/insert upholder<br>/gate/digitizer/Singles/upholder/setUphold 190. keV<br><br><br>#################################################<br># O U T P U T<br># Select the options of the data output <br>
# As there are several modules, settings have <br>
# to be defined for each module, especially in<br># SPECT, where there are a lots of hits for <br># only a few counts, so it's better to limit <br># the amount of data produced Here the <br># SingleDigi output can be used if you have <br>
# your own program to process the data<br>/gate/output/root/enable<br>/gate/output/root/setFileName pinholeSPECT<br>/gate/output/root/setRootHitFlag 1<br>/gate/output/root/setRootSinglesAdderFlag 1<br>/gate/output/root/setRootSinglesBlurringFlag 1 <br>
/gate/output/root/setRootSinglesSpblurringFlag 1<br>/gate/output/root/setRootSinglesThresholderFlag 1<br>/gate/output/root/setRootSinglesUpholderFlag 1<br><br>/gate/output/ascii/enable<br>/gate/output/ascii/setFileName test<br>
/gate/output/ascii/setOutFileHitsFlag 1<br>/gate/output/ascii/setOutFileSinglesFlag 1<br>/gate/output/ascii/setOutFileSinglesAdderFlag 0<br>/gate/output/ascii/setOutFileSinglesSpblurringFlag 0 <br>/gate/output/ascii/setOutFileSinglesBlurringFlag 0<br>
/gate/output/ascii/setOutFileSinglesThresholderFlag 0<br>/gate/output/ascii/setOutFileSinglesUpholderFlag 0<br><br><br>#################################################<br># R A N D O M <br># Change the root of the random module to run different simulations<br>
/gate/random/setEngineName Ranlux64<br>/gate/random/setEngineSeed 123456789<br>/gate/random/verbose 1<br><br><br>#################################################<br># P R O J E C T I O N<br># Makes a set of projections from the crystal <br>
# hits Define the binning the projection module <br># to be used<br>/gate/output/projection/enable<br>/gate/output/projection/setFileName gate<br>/gate/output/projection/pixelSizeX 2.03125 mm<br>/gate/output/projection/pixelSizeY 2.03125 mm<br>
/gate/output/projection/pixelNumberX 128<br>/gate/output/projection/pixelNumberY 128<br># Specify the projection plane (XY, YZ or ZX)<br>/gate/output/projection/projectionPlane YZ<br><br><br>################################################# <br>
# E X P E R I M E N T<br># Define the parameters of the experiment <br># (start time, stop time and time slice)<br># The number of projections depends on the <br># number of time slice, the rotation speed of <br># the system and the number of heads <br>
/gate/application/setTimeSlice 240. s<br>/gate/application/setTimeStart 0. s<br>/gate/application/setTimeStop 240. s<br><br><br>#################################################<br># V E R B O S I T Y<br>
/control/verbose 0<br>/run/verbose 0<br>/event/verbose 0<br>/tracking/verbose 0<br><br><br>#################################################<br># L E T ' S R U N T H E S I M U L A T I O N !<br>/gate/application/startDAQ<br>
</div>
</div></div></div></div>