GATE

GATEの使い方 8 ~Source 1~

How to use GATE 8

admin_bear

今回は入射粒子の設定についてです。
I will explain how to set the particle generation this time.

粒子の種類、エネルギー、入射方向、発生位置に関して細かく指定することができます。
You can specify the particle type, energy, direction and position in detail.

これを読めば入射粒子の設定方法が理解できます!
You can understand how to set the particle generation if you read this article.

GATEの使い方 8
How to use the GATE

粒子の種類
   Type of particle

まず初めに発生させる粒子の種類を指定します。FDG-PET検査を想定する場合、使用する線源は18Fイオン、陽電子、2本のガンマ線の中から選ぶことになります。
First, specify the type of particle you want to generate. For FDG-PET examination, you will choose from 18F ions, positrons, and two gamma rays.

イオンを選択することで、壊変によって放出される電子線やガンマ線が使用可能です。放出割合やエネルギーを手動で計算・指定する必要はありません。娘核種から複雑に放射線が出るような核種に対して有効です。
When ions are used, particles released by nuclear decay are available. You do not need to manually calculate emission probability or energy. It is effective for nuclides that emit various kinds of radiation from daughter nuclides.

陽電子を使用した場合には、角度揺動を考慮することができます。その場合、後述しますが追加のコマンドを記載する必要があります。
When using positrons, the accolinearity can be considered. In that case, the additional command (/gate /source/[mysource_name]/setAccolinearityFlag true) must be written.

光子を反対方向に放出させる方法は単純で、余計な処理を必要としないため、最も高速です。
The method of emitting photons in the opposite direction (the fastest) is simple and does not require extra processing.

イオン   Ion

以下が18Fイオン(A=18、Z=9)を発生させるコマンドの例です。下4行がイオンを使う場合に特有のコマンドです。一番下のコマンドで角度揺動を起こします。線源の名前は「SourceConfinement」としていますが、任意に変更可能です。
The following command is an example to generate 18F ion (A = 18, Z = 9). The last four lines are specific to using ions. The command at the bottom causes accolinearity. The source name is “SourceConfinement”, but you can change it arbitrarily.

# 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 0. 0. 0. cm
/gate/source/SourceConfinement/setActivity 30. Bq
/gate/source/SourceConfinement/gps/angtype iso

/gate/source/SourceConfinement/gps/particle ion
/gate/source/SourceConfinement/gps/ion 9 18 0 0
/gate/source/SourceConfinement/setForcedUnstableFlag true
/gate/source/SourceConfinement/useDefaultHalfLife

/gate/source/SourceConfinement/setAccolinearityFlag true

壊変を使用する場合、下の2行を「physics」に追加する必要があります
If you use radioactive decay, you need to add the following two lines to “physics”.

/gate/physics/addProcess PositronAnnihilation
/gate/physics/addProcess RadioactiveDecay

physicsは「/gate/run/initialize」より前に記載します
You need to write “/gate/run/initialize” before physics section.

陽電子   Positron

次は陽電子を使用する場合です。一番下のコマンドで角度揺動を起こします。線源の名前は「SourceConfinement」としていますが、任意に変更可能です。
The following is an example of using positrons. The command at the bottom enables accolinearity. The source name is “Source Confinement”, but you can change it arbitrarily.

# 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 0. 0. 0. cm
/gate/source/SourceConfinement/setActivity 30. Bq
/gate/source/SourceConfinement/gps/angtype iso

/gate/source/SourceConfinement/gps/particle e+
/gate/source/SourceConfinement/gps/energytype Fluor18
/gate/source/SourceConfinement/setForcedUnstableFlag true
/gate/source/SourceConfinement/setForcedHalfLife 6586 s

/gate/source/SourceConfinement/setAccolinearityFlag true

陽電子は連続エネルギーで18Fイオンから放出されるので、energytypeにFluor18を指定しています(陽電子飛程)。また、半減期が109.8分なので6586秒程度の半減期で数を減らしていきます。
18F ions emit positrons (with a continuous energy spectrum). If you specify Fluor18 as the energy type, you can consider the positron range. Since the half-life is 109.8 minutes, it will be reduced to half in 6586 seconds.

2本のガンマ線(Back-to-back)
   Two gamma rays

最後に2本のガンマ線を正反対に放出させるコマンドです。線源の名前は「SourceConfinement」としていますが、任意に変更可能です。
This command emits two gamma rays in opposite directions. The source name is “Source Confinement”, but you can change it arbitrarily.

# 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 0. 0. 0. cm
/gate/source/SourceConfinement/setActivity 30. Bq
/gate/source/SourceConfinement/gps/angtype iso

/gate/source/SourceConfinement/setType backtoback
/gate/source/SourceConfinement/gps/particle gamma
/gate/source/SourceConfinement/gps/monoenergy 511.0 keV
/gate/source/SourceConfinement/setForcedUnstableFlag true
/gate/source/SourceConfinement/setForcedHalfLife 6586 s

このままでは陽電子の飛程や角度揺動は考慮できませんが、最も高速です。
Without additional commands, the positron range and accolinearity of positrons cannot be considered, but it is the fastest.

エネルギースペクトル
   Energy spectrum

各スペクトルのエネルギーと放出確率をマクロファイルに書く方法もありますが、ここでは外部ファイルに書いておき読み込ませる方法を紹介します。
While there is a way to write emission probabilities for each energy in a macrofile, here’s how to write them in an external file for loading.

離散スペクトル
   Discrete spectrum

今回使用するファイルは以下のものです。Gateを実行するディレクトリに保存してください。
The files used this time are as follows. Save it in the directory where you want to run the Gate.

/gate/source/addSource    mysource    gps
/gate/source/mysource/gps/particle   gamma
/gate/source/mysource/gps/energytype   UserSpectrum
/gate/source/mysource/gps/setSpectrumFile    my_def_spectrum.txt
/gate/source/mysource/setIntensity 1

/gate/source/mysource/gps/centre    0. 0. 0. cm
/gate/source/mysource/setActivity    1000. Bq
/gate/source/mysource/gps/angtype   iso
/gate/source/mysource/gps/type    Volume
/gate/source/mysource/gps/shape    Cylinder
/gate/source/mysource/gps/radius   1. cm
/gate/source/mysource/gps/halfz    3 cm

たぶん「1: 離散スペクトル(Discrete spectrum)」では「0.18」のところは関係ないと思います。
“0.18” is not relevant in “1: Discrete spectrum”.

ヒストグラムのスペクトル
   Histogram spectrum

今回使用するファイルは以下のものです。Gateを実行するディレクトリに保存してください。
The files used this time are as follows. Save it in the directory where you want to run the Gate.

/gate/source/addSource mysource gps
/gate/source/mysource/gps/particle gamma
/gate/source/mysource/gps/energytype UserSpectrum
/gate/source/mysource/gps/setSpectrumFile my_def_spectrum2.txt
/gate/source/mysource/setIntensity 1

/gate/source/mysource/gps/centre 0. 0. 0. cm
/gate/source/mysource/setActivity 1000. Bq
/gate/source/mysource/gps/angtype iso
/gate/source/mysource/gps/type Volume
/gate/source/mysource/gps/shape Cylinder
/gate/source/mysource/gps/radius 1. cm
/gate/source/mysource/gps/halfz 3 cm

線形補間したスペクトル
   Linear interpolation spectrum

今回使用するファイルは以下のものです。Gateを実行するディレクトリに保存してください。
The files used this time are as follows. Save it in the directory where you want to run the Gate.

/gate/source/addSource mysource gps
/gate/source/mysource/gps/particle gamma
/gate/source/mysource/gps/energytype UserSpectrum
/gate/source/mysource/gps/setSpectrumFile my_def_spectrum3.txt
/gate/source/mysource/setIntensity 1

/gate/source/mysource/gps/centre 0. 0. 0. cm
/gate/source/mysource/setActivity 100000. Bq
/gate/source/mysource/gps/angtype iso
/gate/source/mysource/gps/type Volume
/gate/source/mysource/gps/shape Cylinder
/gate/source/mysource/gps/radius 1. cm
/gate/source/mysource/gps/halfz 3 cm

線源の配置
   Placement of source

Point(Default), Volume, Beam, Plane, Surfaceが使えます。
それぞれ紹介したいのですが、使い道が思いつかないのでPoint, Volumeだけ紹介します。それ以外は公式ページを見てください。
You can use point(default), volume, beam, plane, surface as a shape of source.I would like to introduce all of them, but this time I will introduce only Point and Volume. Other than that, please see the official page.

Plane source:Circle, Annulus, Ellipsoid, Square, or Rectangle. 
Surface source:Sphere, Ellipsoid, Cylinder, or Para.
Volume source:Sphere, Ellipsoid, Cylinder, or Para.

点線源   Point source

# D E F I N E  T H E  S O U R C 
/gate/source/addSource mysource gps
/gate/source/mysource/gps/type Point
/gate/source/mysource/gps/centre -20. 0. 0. cm
/gate/source/mysource/setActivity 30. Bq
/gate/source/mysource/gps/angtype iso

/gate/source/mysource/gps/particle gamma
/gate/source/mysource/gps/monoenergy 511. keV
/gate/source/mysource/setForcedUnstableFlag true
/gate/source/mysource/setForcedHalfLife 6586 s
admin_bear

線源の配置は
/gate/source/[source_name]/visualize [number] [color] [size]
で確認できます。
Voxelized sourceなど可視化できないものもあります。
You can verify the placement of the source with “/gate/source/[source_name]/visualize [number] [color] [size]” command. However, voxelized source is an exception.

体積線源 Volume source

Volume線源はこれまでずっと使ってきたtypeなので説明不要ですね。円柱の体積線源は以下の通りです。
Volume source is a familiar type, so explanation is not needed. The volume source of the cylinder is as follows.

# D E F I N E  T H E  S O U R C E
/gate/source/addSource mysource gps
/gate/source/mysource/gps/type Volume
/gate/source/mysource/gps/shape Cylinder
/gate/source/mysource/gps/radius 10. cm
/gate/source/mysource/gps/halfz   2. cm
/gate/source/mysource/gps/centre 0. 0. 0. cm
/gate/source/mysource/setActivity 30. Bq
/gate/source/mysource/gps/angtype iso

/gate/source/mysource/gps/particle gamma
/gate/source/mysource/gps/monoenergy 511. keV
/gate/source/mysource/setForcedUnstableFlag true
/gate/source/mysource/setForcedHalfLife 6586 s

次は平行六面体(parallelepipeds)です。
直方体形としても使えますね。
Parallelpipeds are also used for rectangles.

# D E F I N E  T H E  S O U R C E
/gate/source/addSource mysource gps
/gate/source/mysource/gps/type Volume
/gate/source/mysource/gps/shape Para
/gate/source/mysource/gps/halfx 2 cm
/gate/source/mysource/gps/halfy 4 cm
/gate/source/mysource/gps/halfz 5 cm
/gate/source/mysource/gps/paralp 0 deg
/gate/source/mysource/gps/parthe 0 deg
/gate/source/mysource/gps/parphi 0 deg
/gate/source/mysource/gps/centre 0. 0. 0. cm
/gate/source/mysource/setActivity 30. Bq
/gate/source/mysource/gps/angtype iso

/gate/source/mysource/gps/particle gamma
/gate/source/mysource/gps/monoenergy 511. keV
/gate/source/mysource/setForcedUnstableFlag true
/gate/source/mysource/setForcedHalfLife 6586 s

あれ、最後の奴はparalp 0 deg, parthe 0 deg, parphi 0 degと変わらない・・・
Is the last figure wrong?

計算中の移動と分布範囲の指定
 Movement and specification of range

寝台を動かしながらシミュレーションしたい場合には、VolumeはもちろんSourceも動かす必要があります。方法は2つですが、attachToを使う方が効率がいいです。
If you want to simulate while moving the bed, you need to move the Source as well as the Volume. There are two methods, but using attachTo is more efficient.

取り付け AttachTo

これまで指定してきたように線源の大きさやサイズを決めたあと、Volumeに取り付け(attach)します。そのVolumeが動いた場合、同じ分だけ移動します。
After determining the shape and size of the radiation source, attach it to the Volume. When the Volume moves, it moves the same distance.

線源の配置は物体の座標に対する相対位置を指定します。
物体と同じ分だけ移動します。
物体よりも小さくとも大きくとも問題ありません。
Specify the position of the radiation source relative to the coordinates of the volume.
Move by the same amount as the volume.
No matter if it is smaller or larger than the volume.

以下のような書き方をします
Please refer to the following.

# PHANTOM
/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 10. cm
/gate/Phantom/placement/setTranslation 0. 0. -20. cm
/gate/Phantom/moves/insert translation
/gate/Phantom/translation/setSpeed 0 0 10 cm/s
/gate/Phantom/setMaterial Water
/gate/Phantom/vis/setColor blue
/gate/Phantom/vis/forceWireframe

・・・

/gate/run/initialize

・・・

/gate/source/addSource mysource gps
/gate/source/mysource/gps/type Volume
/gate/source/mysource/gps/shape Cylinder
/gate/source/mysource/gps/radius 5. cm
/gate/source/mysource/gps/halfz  5 cm
/gate/source/mysource/gps/centre 0. 0. 0. cm
/gate/source/mysource/setActivity 9000. Bq
/gate/source/mysource/gps/angtype iso
/gate/source/mysource/gps/particle gamma
/gate/source/mysource/gps/monoenergy 5. keV

#### Attach #####
/gate/source/mysource/attachTo Phantom
← Z axis →

線源の方には移動に関する記述はしていません。また、配置の座標はattachするvolumeに対する相対位置です。
There is no description of movement to the radiation source. Placement coordinates are relative to the attached volume.

制限   Confine

次は指定したVolumeとSourceが重なるところから放射線を放出する方法です。論理演算の「AND」と同じです。
Confinement is a method of emitting radiation from the area where the source overlaps a specified volume. This is the same as the logical operation “AND”.

Source ∩ Volume -> photon or electron emit !

複雑な線源の分布が可能(人体中における骨など)ですが、
線源の範囲が大きいほど、粒子の発生効率が悪くなる(計算速度が低下)ので注意!
Complex source distributions are available (ex bones in the human body). However, the larger the range of the radiation source, the lower the particle generation efficiency (the calculation speed decreases), so be careful!

原理的に、移動する物体から粒子を発生させることも可能ですが、効率が非常に悪いです。AttachToを使いましょう。
As you can see, it is also possible to generate particles from a moving object. However, it is very inefficient. You should use AttachTo.

# PHANTOM
/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 10. cm
/gate/Phantom/placement/setTranslation 2.5 0. 0. cm
/gate/Phantom/moves/insert translation
/gate/Phantom/setMaterial Water
/gate/Phantom/vis/setColor blue
/gate/Phantom/vis/forceWireframe

・・・

/gate/run/initialize

・・・

/gate/source/addSource mysource gps
/gate/source/mysource/gps/type Volume
/gate/source/mysource/gps/shape Cylinder
/gate/source/mysource/gps/radius 5. cm
/gate/source/mysource/gps/halfz  5 cm
/gate/source/mysource/gps/centre -2.5 0. 0. cm
/gate/source/mysource/setActivity 300. Bq
/gate/source/mysource/gps/angtype iso
/gate/source/mysource/gps/particle gamma
/gate/source/mysource/gps/monoenergy 5. keV

### Confine ###
/gate/source/mysource/gps/confine Phantom

Cold source

コールド線源を配置することもできます。
Forbid(禁止)を使用します。
You can use cold source. You use “Forbid” command for that.

# PHANTOM
/gate/world/daughters/name Phantom
/gate/world/daughters/insert cylinder
/gate/Phantom/geometry/setRmax 2.  cm
/gate/Phantom/geometry/setRmin 0. cm
/gate/Phantom/geometry/setHeight 10. cm
/gate/Phantom/placement/setTranslation 1. 3. 0. cm
/gate/Phantom/setMaterial Water
/gate/Phantom/vis/setColor blue
/gate/Phantom/vis/forceWireframe
# PHANTOM2
/gate/world/daughters/name Phantom2
/gate/world/daughters/insert cylinder
/gate/Phantom2/geometry/setRmax 1.  cm
/gate/Phantom2/geometry/setRmin 0. cm
/gate/Phantom2/geometry/setHeight 10. cm
/gate/Phantom2/placement/setTranslation -3. 0. 0. cm
/gate/Phantom2/setMaterial Water
/gate/Phantom2/vis/setColor blue
/gate/Phantom2/vis/forceWireframe
・・・
/gate/run/initialize
・・・
/gate/source/addSource mysource gps
/gate/source/mysource/gps/type Volume
/gate/source/mysource/gps/shape Cylinder
/gate/source/mysource/gps/radius 10. cm
/gate/source/mysource/gps/halfz   1. cm
/gate/source/mysource/gps/centre 0. 0. 0. cm
/gate/source/mysource/setActivity 3000. Bq
/gate/source/mysource/gps/angtype iso
/gate/source/mysource/gps/particle e-
/gate/source/mysource/gps/monoenergy 11. keV
/gate/source/mysource/gps/Forbid Phantom
/gate/source/mysource/gps/Forbid Phantom2
/gate/source/mysource/dump 1

放出角度   Angle

4π方向に粒子を放出させる場合は以下のように書きます。
To emit particles in all directions, write as follows.

/gate/source/addSource mysource gps
/gate/source/mysource/gps/type Point
/gate/source/mysource/gps/centre 0. 0. 0. cm
/gate/source/mysource/setActivity 12000. Bq
/gate/source/mysource/gps/particle gamma
/gate/source/mysource/gps/monoenergy 5. keV
/gate/source/mysource/gps/angtype iso
/gate/source/mysource/gps/mintheta 0 deg
/gate/source/mysource/gps/maxtheta 180 deg
/gate/source/mysource/gps/minphi 0 deg
/gate/source/mysource/gps/maxphi 360 deg
/gate/source/addSource mysource gps
/gate/source/mysource/gps/type Point
/gate/source/mysource/gps/centre 0. 0. 0. cm
/gate/source/mysource/setActivity 12000. Bq
/gate/source/mysource/gps/particle gamma
/gate/source/mysource/gps/monoenergy 5. keV
/gate/source/mysource/gps/angtype iso
/gate/source/mysource/gps/mintheta 0 deg
/gate/source/mysource/gps/maxtheta 135 deg
/gate/source/mysource/gps/minphi 0 deg
/gate/source/mysource/gps/maxphi 360 deg
/gate/source/addSource mysource gps
/gate/source/mysource/gps/type Point
/gate/source/mysource/gps/centre 0. 0. 0. cm
/gate/source/mysource/setActivity 12000. Bq
/gate/source/mysource/gps/particle gamma
/gate/source/mysource/gps/monoenergy 5. keV
/gate/source/mysource/gps/angtype iso
/gate/source/mysource/gps/mintheta 0 deg
/gate/source/mysource/gps/maxtheta 20 deg
/gate/source/mysource/gps/minphi 0 deg
/gate/source/mysource/gps/maxphi 360 deg

あんまり使わないかもしれませんがphiを変えると
If you change “phi”

/gate/source/addSource mysource gps
/gate/source/mysource/gps/type Point
/gate/source/mysource/gps/centre 0. 0. 0. cm
/gate/source/mysource/setActivity 12000. Bq
/gate/source/mysource/gps/particle gamma
/gate/source/mysource/gps/monoenergy 5. keV
/gate/source/mysource/gps/angtype iso
/gate/source/mysource/gps/mintheta 0 deg
/gate/source/mysource/gps/maxtheta 20 deg
/gate/source/mysource/gps/minphi 0 deg
/gate/source/mysource/gps/maxphi 270 deg

入射方向   Direction

4π方向に放射する場合は関係ありませんが、角度を限定している場合は方向を意識する必要があります。初期設定ではZ軸に沿って粒子が放出されます。
Direction must be considered when limiting the angle of particle emission. The Z axis is the default.

角度の指定は以下のコマンドを使用します。
Specify the angle using the command as follows:
rot1 [X] [Y] [Z]

/gate/source/mysource/gps/ang/rot1  1 0 0
/gate/source/mysource/gps/ang/rot2  0 1 0

rot1が1軸目、rot2が2軸目であり、粒子は指定した2つの軸に直交する向きで放射されます。
“rot1” is the first axis and “rot2” is the second axis, and the particles are emitted in the directions orthogonal to the two specified axes.

上の例ではX軸とY軸が指定されているのでXY平面に直交するZ方向に放射されます。
In the above example, the X and Y axes are specified, so they are emitted in the direction orthogonal to the XY plane (Z axis).

/gate/source/addSource mysource gps
/gate/source/mysource/gps/type Point
/gate/source/mysource/gps/centre 0. 0. 0. cm
/gate/source/mysource/setActivity 1200. Bq
/gate/source/mysource/gps/particle gamma
/gate/source/mysource/gps/monoenergy 5. keV
/gate/source/mysource/gps/angtype iso
/gate/source/mysource/gps/mintheta 0 deg
/gate/source/mysource/gps/maxtheta 20 deg
/gate/source/mysource/gps/minphi 0 deg
/gate/source/mysource/gps/maxphi 360 deg
/gate/source/mysource/gps/ang/rot1 0 0 1
/gate/source/mysource/gps/ang/rot2 0 1 0
admin_bear

DICOM画像の画素値をもとに線源の配置する方法は、今度紹介します。
I will introduce the method of arranging the radiation source based on the pixel value of the DICOM image.