Crystal/Module的index
以Z方向为例,如果repeater里的数目是N,那么index就是0到N-1.
如果N是偶数,0点在N/2-1和N/2之间;如果N是奇数,0点在第(N-1)/2个crystal/module的中间。。。
GATE指的是Geant4 Application for Emission Tomography. 这里是几个学习GATE的中国人的博客兼邮件列表。欢迎加入我们的学习团队!
以Z方向为例,如果repeater里的数目是N,那么index就是0到N-1.
Dear fellow GATE users,
I am working on this problem already for a while. I am trying to
simulate a basic pinhole SPECT system, and at the moment I am mainly
interested in projection images using the Interfile output. So far I can
generate projection images of a point source, but for some reason, not
matter what SPblurring parameter I set (0mm, 5mm, 10mm) I don't get
any change in the resulting projection images. In the end I would like
to use digigate to simulate different detector responses.
I would greatly appreciate any help you can provide, since I already
exhausted all other sources.
Thanks,
chris
Here is a snapshot of my .mac file:
#############################################
# V I S U A L I S A T I O N
/control/execute visu.mac
/tracking/storeTrajectory 1
/gate/geometry/enableAutoUpdate
#############################################
# V E R B O S I T Y
/gate/output/verbose 2
#############################################
# W O R L D
# Define the world dimensions
/gate/world/geometry/setXLength 1000 mm
/gate/world/geometry/setYLength 1000 mm
/gate/world/geometry/setZLength 1000 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 9 cm away from the Z axis,
# which is the rotation axis and the
# replication axis
/gate/SPECThead/placement/setTranslation 200. 0. 0. mm
# Set the material associated with the main volume
/gate/SPECThead/setMaterial Air
/gate/SPECThead/attachPhantomSD
# Define the rotation speed of the head
# Define the orbiting around the Z axis
/gate/SPECThead/moves/insert orbiting
/gate/SPECThead/orbiting/setSpeed 0.5625 deg/s
/gate/SPECThead/orbiting/setPoint1 0. 0. 0. mm
/gate/SPECThead/orbiting/setPoint2 0. 0. 1. mm
# 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 2.5 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 7.5 mm
/gate/cone1/geometry/setHeight 9 mm
/gate/cone1/geometry/setRmax1 10. mm
/gate/cone1/geometry/setRmax2 2.5 mm
#/gate/cone1/placement/setTranslation -6.25 0 0 mm
/gate/cone1/placement/setTranslation - 5.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 7.5 mm
/gate/cone2/geometry/setHeight 9 mm
/gate/cone2/geometry/setRmax1 2.5 mm
/gate/cone2/geometry/setRmax2 10. mm
#/gate/cone2/placement/setTranslation 6.25 0 0 mm
/gate/cone2/placement/setTranslation 5.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 170 mm
/gate/aircomp/geometry/setYLength 260 mm
/gate/aircomp/geometry/setZLength 260 mm
/gate/aircomp/placement/setTranslation -45 0 0 mm
/gate/aircomp/vis/forceWireframe
############################################
# 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 6. mm
/gate/crystal/geometry/setYLength 260. mm
/gate/crystal/geometry/setZLength 260. mm
# Define the position of the crystal volume
/gate/crystal/placement/setTranslation 43. 0. 0. mm
# Set the material associated with the crystal
# volume
/gate/crystal/setMaterial NaI
# Define some visualisation options
/gate/crystal/vis/setColor yellow
###########################################
# 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 30. 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 61. 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 cylinder
# Define the dimensions of the phantom
# volume
/gate/Phantom/geometry/setRmax 0.5 mm
/gate/Phantom/geometry/setRmin 0. mm
/gate/Phantom/geometry/setHeight 0.5 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
/gate/Phantom/attachPhantomSD
#############################################
# M O V I N G S O U R C E
# Add an extra object for source confinement
/gate/Phantom/daughters/name movsource
/gate/Phantom/daughters/insert cylinder
# Define the dimensions of the source volume
/gate/movsource/geometry/setRmax 0.5 mm
/gate/movsource/geometry/setRmin 0. mm
/gate/movsource/geometry/setHeight 0.5 mm
# Set the material corresponding to the
# phantom volume
/gate/movsource/setMaterial Water
# Define some visualisation options
/gate/movsource/vis/setColor magenta
/gate/movsource/attachPhantomSD
/control/execute timing.mac
#################################
# SENSITIVE DETECTORS
# 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/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
#############################################
# 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 1
/gate/digitizer/Singles/insert thresholder
/gate/digitizer/Singles/thresholder/setThreshold 20. keV
/gate/digitizer/Singles/insert upholder
/gate/digitizer/Singles/upholder/setUphold 190. keV
#############################################
# 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
# Select the processes to consider
/gate/physics/gamma/selectRayleigh lowenergy
/gate/physics/gamma/selectPhotoelectric lowenergy
/gate/physics/gamma/selectCompton lowenergy
/gate/physics/gamma/selectGammaConversion inactive
/gate/physics/gamma/listProcesses
# Set some cuts to speed up the simulation
# X-rays are tracked until their energy fell
# under 20 keV
/gate/physics/setXRayCut 20. keV
# Cut in order not to follow the secondary
# electrons
/gate/physics/setElectronCut 1. km
/gate/physics/setDeltaRayCut 1. GeV
# 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 Cylinder
# Define the dimensions of the source
/gate/source/SourceConfinement/gps/radius 0.5 mm
/gate/source/SourceConfinement/gps/halfz 0.25 mm
# 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/energytype Mono
/gate/source/SourceConfinement/gps/energy 140. keV
# Set the activity of the source
/gate/source/SourceConfinement/setActivity 500000. Bq
# Define a confinement
# the activity cannot move with time so the attenuating
# medium is moved and the activity is forced to be in the
# attenuating medium
/gate/source/SourceConfinement/gps/confine movsource_P
# Define the emission direction (4 str)
/gate/source/SourceConfinement/gps/angtype iso
/gate/source/SourceConfinement/gps/mintheta 0. deg
/gate/source/SourceConfinement/gps/maxtheta 180. deg
/gate/source/SourceConfinement/gps/minphi 0. deg
/gate/source/SourceConfinement/gps/maxphi 360. deg
#############################################
# R A N D O M
# Change the root of the random module to run different simulations
/gate/output/root/setSaveRndmFlag 1
#############################################
# 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/setFileName pinholeSPECT
/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/root/setRootHitFlag 0
#/gate/output/root/setRootSinglesFlag 0
#/gate/output/root/setRootCoincidencesFlag 0
#/gate/output/root/setRootNtupleFlag 0
#/gate/output/ascii/disable
/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
#############################################
# 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/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 10. s
/gate/application/setTimeStart 0. s
/gate/application/setTimeStop 10. s
#############################################
# V E R B O S I T Y
/control/verbose 0
/grdm/verbose 0
/run/verbose 0
/event/verbose 0
/tracking/verbose 0
/gate/application/verbose 0
/gate/generator/verbose 0
/gate/stacking/verbose 0
/gate/event/verbose 0
/gate/source/verbose 0
/gate/output/projection/verbose 0
/gate/output/verbose 0
# LET'S RUN THE SIMULATION!
/gate/application/startDAQ
用Gate的root格式输出,读出下面几个值:rsectorID,moduleID,globalPosX,globalPosY,globalPosZ
Gate在用repeater构建detector的时候,crystal的index是以什么样的顺序?对Mosaic来说,axial方向最后面的crystal为0,最前面的为51;transaxial方向最右边的为0,顺时针方向增大至277.
1. 用我的c程序生成analyze格式的mouse brain phantom
If the number in the ASCII file, for a given voxel, is for instance between 221 and 230, then the activity for that voxel is set to 5. Bq.
一个range translation table for numbers to activities (activityRange.dat ) 的例子:
在gate_v3.1.0/src/GateGeometryVoxelInterfileReader.cc里有这样一个函数:
/gate/vxphantom/interfileReader/readFile MouseBrain.h33
hoffman brain phantom 的例子是 :
5
0 0 Air false 0.0 0.0 0.0 0.2
0 33 Lung false 1.0 0.0 0.0 0.2
33 53 Breast flase 0.0 1.0 0.0 0.2
53 75 Plastic true 0.0 0.0 1.0 0.2
75 200 Air false 0.0 0.0 0.0 0.2
The first line must contain the number of materials (i.e. the number of subse-
quent lines). The following lines contain either a material number (or range) followed by a material name
(for the old format) or, for the new format, a material number (or range), a material name, a visibility
boolean (true or false) and color attribute values (red, green, blue, alpha). If the old format is used, the
phantom will be of a uniform dark red color.
Hi,
In fact, you need to define a material for each pixel range (from 0 to
200 in the case off hoffman brain phantom which is include in the
example folder)
ex :
5
0 0 Air false 0.0 0.0 0.0 0.2
0 33 Lung false 1.0 0.0 0.0 0.2
33 53 Breast flase 0.0 1.0 0.0 0.2
53 75 Plastic true 0.0 0.0 1.0 0.2
75 200 Air false 0.0 0.0 0.0 0.2
cheers
seb
Susana Silva a écrit:
> Hi, everyone!
>
> I have a problem when i'm trying to use the hoffman brain phantom in the new version.
> The problem is the following: when GATE is reading the interfile "hof3.h33" appears this message continuosly (i need to press ctrl+c to stop it):
>
>
> GateGeometryVoxelInterfileReader::ReadFile: WARNING: voxel not added (material translation not found); value: 200
> GateGeometryVoxelInterfileReader::ReadFile: WARNING: voxel not added (material translation not found); value: 200
> [...]
>
> Can anyone help me?
>
> Thanks in advance,
>
> Susana Silva
>
GATE Users Guide ,Version 3.0.0 (27 July 2006)
parameterizedBoxMatrix 比 replicaMatrix 更好地被 geant 支持
读了半天manual也不得要领。readFile命令要求什么样的文件格式呢?Translator是怎么回事?
发现如果先定义detector再定义collimator(包括holes),holes的生成就特别慢;如果先定义collimator再定义detector就变得飞快。不确定先后顺序有没有问题。
如果定义B是A的daughter,那么在setTranslation移动mother的时候,daughter也会一起动。
如果想把物体分别绕三个轴各旋转多少度,不能用三次setRotationAngle,即下面的方法是错误的:
setTranslation与setRotationAngle每次移动物体时,是在以前一个位置的基础上,还是每次都是从原点开始?
下面是Gate-users邮件列表里面的一封:
Dear Gaters,
The last Gate version, gate v3.1.0, is now available on our official
web
site.
_/http://opengatecollaboration.healthgrid.org/GATEregisteredUsers/download_index.php/_
This version includes tools to run Gate on a cluster architecture.
Find all informations about new developments and installation
configurations in the README and ReleaseNotes.pdf files.
For details about developments (specially for cluster tools), you can
download the last User's Guide version : v3.1.0.
All the best
Sebastien JAN
新的Gate3.1.0启动正常。
我在Geant4 8.1上面装了Gate 3.0.0,据说不是很好。碰到一些问题,也不知道是不是版本造成的。今天去Gate主页发现正巧刚刚发布3.1.0,所以就来升级一下吧。
如果定义了FOV,里面有daughters比如phantom和collimator,那么每个都需要用一遍attachPhantomSD命令么?
Collimator需要attachPhantomSD么?
GATE, the Geant4 Application for Emission Tomography, incorporates the Geant4 libraries in a modular, versatile, and scripted simulation toolkit which is adapted to the field of nuclear medicine. In addition, GATE allows the accurate description of time-dependent phenomena such as source or detector movement and source decay kinetics. The ability to synchronize all time-dependent components allows a coherent description of the acquisition process and is one of the most innovative features of GATE. It makes it possible to perform realistic simulations of data acquisitions in time. The example below shows the simulation of the decay of O-15 (in green) and C-11 (in blue) sources throughout 3 time frames with the GATE: 0-2 min (left), 7-9 min (centre), and 14-16 min (right). On all frames, one detector has been hidden (gap in the detector ring) to illustrate the scanner rotation steps.
In addition to the timing features, a dedicated scripting mechanism extends the native command interpreter of Geant4 and allows to perform and control the Monte Carlo simulation in an intuitive manner. Moreover, the Geant4 interaction histories or hits can be further processed to realistically mimic detector output pulses. This digitization of the hits allows for the modeling of the detector response by using a chain of processing modules designed by the user. In the example below, GATE has been used to study the effect of detector dead-time (DT) and coincidence time window duration (CW) on the Noise Equivalent Count (NEC) rate of a prospective small animal PET scanner design. Detector electronic response was modeled including detector cross-talk, transfer efficiency of the scintillation photons to the photodetector, quantum efficiency of the photodetector, detector energy resolution, and trigger efficiency.
这里是Gate中文学习小组。如果你也在学习和使用Gate,欢迎你加入我们的小组,并且共同来写这个学习博客。下面是加入我们的方法: