[Gate-users] How to make complicate phantom
윤창연
yudoldosa at hanmail.net
Tue Feb 24 08:41:23 CET 2015
Hi, Hojjat.
Thank you for your advice.
Here is my code.
# V I S U A L I S A T I O N
#####
/vis/disable
#/control/execute vis.mac
# M A N D A T O R Y
#####
/gate/geometry/setMaterialDatabase /GATE/gate_v7.0/GateMaterials.db
# G E O M E T R Y
#####
/control/execute Geometry.mac
#/gate/geometry/rebuild
# C O L L I M A T O R
##
/control/execute Collimator.mac
#/gate/geometry/rebuild
# C R Y S T A L
##
/control/execute Crystal.mac
#/gate/geometry/rebuild
# P H A N T O M
# Create the phantom volume (Plastic)
##
/gate/world/daughters/name Phantom
/gate/world/daughters/insert cylinder
/gate/Phantom/geometry/setRmax 2 cm
/gate/Phantom/geometry/setHeight 4 cm
/gate/Phantom/placement/setTranslation 0 0 0 cm
/gate/Phantom/placement/setRotationAxis 0 1 0
/gate/Phantom/placement/setRotationAngle 90 deg
/gate/Phantom/setMaterial Plastic
/gate/Phantom/vis/setColor blue
/gate/Phantom/vis/forceWireframe
#
# Create the phantom volume (Air for Ce)
#
/gate/Phantom/daughters/name Phantom_Air_1
/gate/Phantom/daughters/insert cylinder
/gate/Phantom_Air_1/geometry/setRmax 0.5 cm
/gate/Phantom_Air_1/geometry/setHeight 3.9 cm
/gate/Phantom_Air_1/placement/setTranslation 0 1.05 0 cm
/gate/Phantom_Air_1/setMaterial Air
/gate/Phantom_Air_1/vis/setColor blue
/gate/Phantom_Air_1/vis/forceWireframe
#
# Create the phantom volume (Air for Gd)
#
/gate/Phantom/daughters/name Phantom_Air_2
/gate/Phantom/daughters/insert cylinder
/gate/Phantom_Air_2/geometry/setRmax 0.5 cm
/gate/Phantom_Air_2/geometry/setHeight 3.9 cm
/gate/Phantom_Air_2/placement/setTranslation -0.909327 -0.525 0 cm
/gate/Phantom_Air_2/setMaterial Air
/gate/Phantom_Air_2/vis/setColor blue
/gate/Phantom_Air_2/vis/forceWireframe
#
# Create the phantom volume (Air for W)
#
/gate/Phantom/daughters/name Phantom_Air_3
/gate/Phantom/daughters/insert cylinder
/gate/Phantom_Air_3/geometry/setRmax 0.5 cm
/gate/Phantom_Air_3/geometry/setHeight 3.9 cm
/gate/Phantom_Air_3/placement/setTranslation 0.909327 -0.525 0 cm
/gate/Phantom_Air_3/setMaterial Air
/gate/Phantom_Air_3/vis/setColor blue
/gate/Phantom_Air_3/vis/forceWireframe
#
# Create the phantom (detector) volume (Ce)
##
/gate/world/daughters/name Inner_Phantom_1
/gate/world/daughters/systemType SPECThead
/gate/world/daughters/insert cylinder
/gate/Inner_Phantom_1/geometry/setRmax 0.5 cm
/gate/Inner_Phantom_1/geometry/setHeight 3.9 cm
/gate/Inner_Phantom_1/placement/setRotationAxis 0 1 0
/gate/Inner_Phantom_1/placement/setRotationAngle 90 deg
/gate/Inner_Phantom_1/placement/setTranslation 0 1.05 0 cm
/gate/Inner_Phantom_1/setMaterial Cerium
/gate/Inner_Phantom_1/vis/setColor grey
#
# Create the phantom crystal (detector) volume (Ce)
##
/gate/Inner_Phantom_1/daughters/name Inner_Phantom_Crystal_1
/gate/Inner_Phantom_1/daughters/insert cylinder
/gate/Inner_Phantom_Crystal_1/geometry/setRmax 0.5 cm
/gate/Inner_Phantom_Crystal_1/geometry/setHeight 3.9 cm
/gate/Inner_Phantom_Crystal_1/placement/setTranslation 0. 0. 0. cm
/gate/Inner_Phantom_Crystal_1/setMaterial Cerium
/gate/Inner_Phantom_Crystal_1/vis/setColor yellow
#
# Create the phantom (detector) volume (Gd)
##
/gate/world/daughters/name Inner_Phantom_2
/gate/world/daughters/systemType SPECThead
/gate/world/daughters/insert cylinder
/gate/Inner_Phantom_2/geometry/setRmax 0.5 cm
/gate/Inner_Phantom_2/geometry/setHeight 3.9 cm
/gate/Inner_Phantom_2/placement/setRotationAxis 0 1 0
/gate/Inner_Phantom_2/placement/setRotationAngle 90 deg
/gate/Inner_Phantom_2/placement/setTranslation 0 -0.525 0.909327 cm
/gate/Inner_Phantom_2/setMaterial Gadolinium
/gate/Inner_Phantom_2/vis/setColor grey
#
# Create the phantom crystal (detector) volume (Gd)
##
/gate/Inner_Phantom_2/daughters/name Inner_Phantom_Crystal_2
/gate/Inner_Phantom_2/daughters/insert cylinder
/gate/Inner_Phantom_Crystal_2/geometry/setRmax 0.5 cm
/gate/Inner_Phantom_Crystal_2/geometry/setHeight 3.9 cm
/gate/Inner_Phantom_Crystal_2/placement/setTranslation 0. 0. 0. cm
/gate/Inner_Phantom_Crystal_2/setMaterial Gadolinium
/gate/Inner_Phantom_Crystal_2/vis/setColor yellow
#
# Create the phantom (detector) volume (W)
##
/gate/world/daughters/name Inner_Phantom_3
/gate/world/daughters/systemType SPECThead
/gate/world/daughters/insert cylinder
/gate/Inner_Phantom_3/geometry/setRmax 0.5 cm
/gate/Inner_Phantom_3/geometry/setHeight 3.9 cm
/gate/Inner_Phantom_3/placement/setRotationAxis 0 1 0
/gate/Inner_Phantom_3/placement/setRotationAngle 90 deg
/gate/Inner_Phantom_3/placement/setTranslation 0 -0.525 -0.909327 cm
/gate/Inner_Phantom_3/setMaterial Tungsten
/gate/Inner_Phantom_3/vis/setColor grey
#
# Create the phantom crystal (detector) volume (W)
##
/gate/Inner_Phantom_3/daughters/name Inner_Phantom_Crystal_3
/gate/Inner_Phantom_3/daughters/insert cylinder
/gate/Inner_Phantom_Crystal_3/geometry/setRmax 0.5 cm
/gate/Inner_Phantom_Crystal_3/geometry/setHeight 3.9 cm
/gate/Inner_Phantom_Crystal_3/placement/setTranslation 0. 0. 0. cm
/gate/Inner_Phantom_Crystal_3/setMaterial Tungsten
/gate/Inner_Phantom_Crystal_3/vis/setColor yellow
# 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/SPECT_CdTe/crystal/attach Crystal_CdTe
##/gate/systems/SPECT_CdTe/describe
#/gate/systems/SPECT_CsI/crystal/attach Crystal_CsI
##/gate/systems/SPECT_CsI/describe
/gate/systems/Inner_Phantom_1/crystal/attach Inner_Phantom_Crystal_1
#/gate/systems/Inner_Phantom_1/describe
/gate/systems/Inner_Phantom_2/crystal/attach Inner_Phantom_Crystal_2
#/gate/systems/Inner_Phantom_2/describe
/gate/systems/Inner_Phantom_3/crystal/attach Inner_Phantom_Crystal_3
#/gate/systems/Inner_Phantom_3/describe
# S E N S I T I V E D E T E C T O R S
######
# GATE provides two sensitive detectors, which have two different functions
# Using them properly is very important for getting accurate results
##
# Crystal SD
#
# The crystal SD makes it possible to record hits in a sensitive volume
(e.g.,. in a scintillation crystal)
# It must be attached to any volume for which hit-data must be obtained
# For recording hits in the NaI volume only, the name of which is crystal,
this volume is attached
# to the crystal SD
##
#/gate/Crystal_CdTe/attachCrystalSD
#/gate/Crystal_CsI/attachCrystalSD
/gate/Inner_Phantom_Crystal_1/attachCrystalSD
/gate/Inner_Phantom_Crystal_2/attachCrystalSD
/gate/Inner_Phantom_Crystal_3/attachCrystalSD
# Phantom SD
#
# The phantom SD makes it possible to record Compton events in the volumes
within the field of view
# This can provide information for result analysis to discriminate between
# scattered and unscattered photons
# It must be attached to each and every volume for whom Compton
interactions have to be recorded
##
/gate/Phantom/attachPhantomSD
/gate/Phantom_Air_1/attachPhantomSD
/gate/Phantom_Air_2/attachPhantomSD
/gate/Phantom_Air_3/attachPhantomSD
/gate/SPECT_CdTe/attachPhantomSD
/gate/Collimator/attachPhantomSD
/gate/SPECT_CsI/attachPhantomSD
#/gate/Inner_Phantom_1/attachPhantomSD
#/gate/Inner_Phantom_2/attachPhantomSD
#/gate/Inner_Phantom_3/attachPhantomSD
# 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 StandardModel
/gate/physics/addProcess Bremsstrahlung
/gate/physics/processes/Bremsstrahlung/setModel StandardModel
/gate/physics/processList Enabled
/gate/physics/processList Initialized
/gate/run/initialize
# D E F I N E T H E S O U R C E
#####
/gate/source/addSource Source
/gate/source/Source/gps/type Point
/gate/source/Source/gps/centre 0 0 30 cm
/gate/source/Source/gps/particle gamma
/gate/source/Source/gps/energy 150 keV
/gate/source/Source/setActivity 300000. Bq
/gate/source/Source/gps/angtype iso
/gate/source/Source/gps/mintheta 0 deg
/gate/source/Source/gps/maxtheta 5 deg
#/gate/source/Source/gps/minphi 0 deg
#/gate/source/Source/gps/maxphi 360 deg
#/gate/source/Source/visualize 100000 red 1
/gate/source/list
/gate/digitizer/Singles/insert adder
# 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/ascii/disable
/gate/output/ascii/enable
/gate/output/ascii/setOutFileHitsFlag 0
/gate/output/ascii/setOutFileSinglesFlag 1
/gate/output/ascii/setFileName SPECT_
/gate/output/ascii/setSingleMask 1 1 0 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0
#/gate/output/ascii/setOutFileSizeLimit 104857600
# R A N D O M
# #
/gate/random/setEngineSeed auto
/gate/random/verbose 1
/gate/random/verbose 1
# 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 1. s
/gate/application/setTimeStart 0. s
/gate/application/setTimeStop 200. 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
When I disable outer phantom volume, correct output file is obtained.
Is there any problem in code ??
Thank you.
From: gate-users-bounces at lists.opengatecollaboration.org [mailto:gate-users-
bounces at lists.opengatecollaboration.org] On Behalf Of Hojjat Mahani
Sent: Wednesday, February 18, 2015 12:04 AM
To: GATErs
Subject: Re: [Gate-users] How to make complicate phantom
Hi,
The provided code seems to be correct for such a multi-system Gate
simulation. I think the problem may come from the rest of your script (for
example, "digitizer" modules) where you should specify readout level.
P.S.: I would recommend you to use a more generalized system type,
"scanner", instead of the "SPECThead" one.
Good luck,
Hojjat
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opengatecollaboration.org/mailman/private/gate-users/attachments/20150224/1dea78c5/attachment-0001.html>
More information about the Gate-users
mailing list