GATE Benchmark SPECT example 국립암센터 박 세 준
General Simulation Architecture 1.define the scanner geometry 2.define the phantom geometry 3.set up the physics processes 4.initialize the simulation 5.set up the detector model 6.define the source 7.specify the data output format 8.start the acquisition
benchSPECT.mac # V I S U A L I S A T I O N ##### #/vis/disable #/control/execute vis.mac #V I S U A L I S A T I O N /vis/open OGLSX /vis/viewer/set/viewpointThetaPhi /vis/viewer/zoom 1.5 /vis/drawVolume /vis/viewer/flush /tracking/verbose 0 /tracking/storeTrajectory 1 /vis/scene/add/trajectories /vis/scene/endOfEventAction accumulate # M A N D A T O R Y ##### /gate/geometry/setMaterialDatabase../../GateMaterials.db x y z Theta Phi
# G E O M E T R Y ##### # World # Define the world dimensions ## /gate/world/geometry/setXLength 100 cm /gate/world/geometry/setYLength 100 cm /gate/world/geometry/setZLength 100 cm # Scanner Head /gate/world/daughters/name SPECThead /gate/world/daughters/insert box /gate/SPECThead/geometry/setXLength 7. cm /gate/SPECThead/geometry/setYLength 21. cm /gate/SPECThead/geometry/setZLength 30. cm /gate/SPECThead/placement/setTranslation cm /gate/SPECThead/setMaterial Air /gate/SPECThead/repeaters/insert ring /gate/SPECThead/ring/setRepeatNumber 4 /gate/SPECThead/moves/insert orbiting /gate/SPECThead/orbiting/setSpeed 0.15 deg/s /gate/SPECThead/orbiting/setPoint cm /gate/SPECThead/orbiting/setPoint cm /gate/SPECThead/vis/forceWireframe benchSPECT.mac z ab c setTranslation a/2 – z/2 a+b/2-z/2 a+b+c/2-z/2 world SPECThead shielding collimatorcrystalcompartment TablePhantom Source orbiting speed * time slice = sampling angle or /forceSolid
benchSPECT.mac # Shielding # Create the shielding volume ## /gate/SPECThead/daughters/name shielding /gate/SPECThead/daughters/insert box /gate/shielding/geometry/setXLength 7. cm /gate/shielding/geometry/setYLength 21. cm /gate/shielding/geometry/setZLength 30. cm /gate/shielding/placement/setTranslation cm /gate/shielding/setMaterial Lead /gate/shielding/vis/setColor red /gate/shielding/vis/forceWireframe # Collimator # Create a full volume defining the shape of the collimator ## /gate/SPECThead/daughters/name collimator /gate/SPECThead/daughters/insert box /gate/collimator/geometry/setXLength 3. cm /gate/collimator/geometry/setYLength 19. cm /gate/collimator/geometry/setZLength 28. cm /gate/collimator/placement/setTranslation cm /gate/collimator/setMaterial Lead /gate/collimator/vis/setColor red /gate/collimator/vis/forceWireframe # # Insert the first hole of air in the collimator ## /gate/collimator/daughters/name hole /gate/collimator/daughters/insert hexagone /gate/hole/geometry/setHeight 3. cm /gate/hole/geometry/setRadius.15 cm /gate/hole/placement/setRotationAxis /gate/hole/placement/setRotationAngle 90 deg /gate/hole/setMaterial Air # # Repeat the hole in an array ## /gate/hole/repeaters/insert cubicArray /gate/hole/cubicArray/setRepeatNumberX 1 /gate/hole/cubicArray/setRepeatNumberY 52 /gate/hole/cubicArray/setRepeatNumberZ 44 /gate/hole/cubicArray/setRepeatVector cm # # Repeat these holes in a linear ## /gate/hole/repeaters/insert linear /gate/hole/linear/setRepeatNumber 2 /gate/hole/linear/setRepeatVector cm repeaters 종류 1.Linear repeater 2.Ring repeater 3.Cubic Array repeater 4.Quadrant repeater 5.Sphere repeater 6.Generic repeater ?
benchSPECT.mac # CRYSTAL # Create the crystal volume ## /gate/SPECThead/daughters/name crystal /gate/SPECThead/daughters/insert box /gate/crystal/geometry/setXLength 1. cm /gate/crystal/geometry/setYLength 19. cm /gate/crystal/geometry/setZLength 28. cm /gate/crystal/placement/setTranslation cm /gate/crystal/setMaterial NaI /gate/crystal/vis/setColor yellow # BACK-COMPARTMENT # Create the back-compartment volume ## /gate/SPECThead/daughters/name compartment /gate/SPECThead/daughters/insert box /gate/compartment/geometry/setXLength 2.5 cm /gate/compartment/geometry/setYLength 19. cm /gate/compartment/geometry/setZLength 28. cm /gate/compartment/placement/setTranslation cm /gate/compartment/setMaterial Glass /gate/compartment/vis/setColor grey # TABLE # Create the table volume ## /gate/world/daughters/name table /gate/world/daughters/insert box /gate/table/geometry/setXLength 0.6 cm /gate/table/geometry/setYLength 8. cm /gate/table/geometry/setZLength 34. cm /gate/table/placement/setRotationAxis /gate/table/placement/setRotationAngle 90 deg /gate/table/placement/setTranslation cm /gate/table/moves/insert translation /gate/table/translation/setSpeed cm/s /gate/table/setMaterial Glass /gate/table/vis/setColor grey # PHANTOM # Create the phantom volume ## /gate/world/daughters/name Phantom /gate/world/daughters/insert cylinder /gate/Phantom/geometry/setRmax 5. cm /gate/Phantom/geometry/setRmin 0. cm /gate/Phantom/geometry/setHeight 20. cm /gate/Phantom/placement/setTranslation cm /gate/Phantom/moves/insert translation /gate/Phantom/translation/setSpeed cm/s /gate/Phantom/setMaterial Water /gate/Phantom/vis/setColor blue /gate/Phantom/vis/forceWireframe Moving 종류 1.Translation 2.Rotation 3.Orbiting 4.Wobbling 5.Eccentric rotation 6.Generic 7.Generic repeater
benchSPECT.mac # SOURCE # Add an extra object for source confinement ## /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 cm /gate/movsource/setMaterial Water /gate/movsource/vis/setColor magenta # S Y S T E M /gate/systems/SPECThead/crystal/attach crystal /gate/systems/SPECThead/describe # S E N S I T I V E D E T E C T O R S # Crystal SD /gate/crystal/attachCrystalSD # Phantom SD /gate/Phantom/attachPhantomSD /gate/movsource/attachPhantomSD /gate/table/attachPhantomSD /gate/compartment/attachPhantomSD /gate/shielding/attachPhantomSD /gate/SPECThead/attachPhantomSD /gate/collimator/attachPhantomSD # P H Y S I C S ##### /gate/physics/addProcess PhotoElectric /gate/physics/addProcess LowEnergyCompton /gate/physics/addProcess LowEnergyRayleighScattering /gate/physics/addProcess ElectronIonisation /gate/physics/addProcess Bremsstrahlung /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 # I N I T I A L I Z A T I O N ##### /gate/run/initialize Phantom SD compton, rayleigh 산란에 의한 영향을 분석 유효시야 내 산란영향을 받을 수 있는 모든 volume 에 붙임 Source Volume 일뿐. 실제 source 는 뒤에
benchSPECT.mac # Show how the geometry moves with time # ! After the initialization ! ## /gate/timing/setTime 0. s /gate/timing/setTime 37.5 s /gate/timing/setTime 75 s /gate/timing/setTime s /gate/timing/setTime 150 s /gate/timing/setTime s /gate/timing/setTime 225 s /gate/timing/setTime s /gate/timing/setTime 300 s /gate/timing/setTime s /gate/timing/setTime 375 s /gate/timing/setTime s /gate/timing/setTime 450 s /gate/timing/setTime s /gate/timing/setTime 525 s /gate/timing/setTime s /gate/timing/setTime 600 s # D E F I N E T H E S O U R C E ##### /gate/source/addSource SourceConfinement /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 cm /gate/source/SourceConfinement/gps/particle gamma /gate/source/SourceConfinement/gps/energy 140. keV /gate/source/SourceConfinement/setActivity Bq /gate/source/SourceConfinement/gps/angtype iso # Define a confinement /gate/source/SourceConfinement/gps/confine movsource # 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.10 /gate/digitizer/Singles/blurring/setEnergyOfReference 140. keV /gate/digitizer/Singles/insert spblurring /gate/digitizer/Singles/spblurring/setSpresolution 2.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 이 부분이 실제 source without spblurring with spblurring
benchSPECT.mac # O U T P U T /gate/output/root/enable /gate/output/root/setFileName benchSPECT /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 # R A N D O M # JamesRandom Ranlux64 MersenneTwister /gate/random/setEngineName Ranlux64 #/gate/random/setEngineSeed default #/gate/random/setEngineSeed auto /gate/random/setEngineSeed #/gate/random/resetEngineFrom fileName /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 mm /gate/output/projection/pixelSizeY 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 # Here, define a total acquisition of 8 seconds by step of 0.05 seconds # This will give 8 projections by head by table position ## /gate/application/setTimeSlice 37.5 s /gate/application/setTimeStart 0. s /gate/application/setTimeStop 600. 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 4 page sampling angle = orbiting speed * time slice 0.15 deg/s * 37.5 s = deg 가급적이면 아래와 같이 맞추어 줄 것을 권장 pixelSizeX * pixelNumberX = crystal Ylength pixelSizeY * pixelNumberY = crystal Zlength setTimeStop / setTimeSlice = 반드시 정수이어야