[Gate-users] Gate-users Digest, Vol 182, Issue 6

Atiq Ur Rahman atiqchep at gmail.com
Thu Jul 8 05:57:00 CEST 2021


Dear users,
In my previous email, the text formatting was a bit weird. I am combining
my both emails.
I am trying to calculate the dose for the CT based Phantom (512x512x361
matrix) using a proton beam. I read dicom images directly and define the HU
to material conversion file.  I am using the vGate.8 virtual machine.
Problem: If I define only three materials (vacuum, Air ,TissueEquivalent )
the simulation gives output for 1000 primaries very fast in a couple of
seconds and I can get the output. But if I define one extra material (any
material, I have tried different materials) , let say (Vacuum, Air,
TissueEquvalent, Liver)  the simulation runs for a very very long time even
for 1 primary particle (Actually does not finish even in 10 hours). Can you
give me some suggestions to fix the problem. What is the  possible cause of
the problem? There seems to be something wrong with my approach. I have
shared my code below.  I have 361 Dicom images put in a single directory.
You can reproduce my problem using downloading the code directly:
https://drive.google.com/drive/folders/1r2LPzE7KLZX0-kfVTNaQyWADLgelVdR9?usp=sharing
Definition of the HUToMat.txt
-2000 -800   Vacuum
-800  -40    Air
-40    200   Blood
200    19000 TissueEquivalent
#CODE
/control/execute mac/verbose.mac
/gate/geometry/setMaterialDatabase      GateMaterials.db
#WorldVolume
/gate/world/setMaterial                           Vacuum
/gate/world/geometry/setXLength           100 cm
/gate/world/geometry/setYLength           100 cm
/gate/world/geometry/setZLength           100 cm

/gate/world/daughters/name                  Pat
/gate/world/daughters/insert                 box
/gate/Pat/geometry/setXLength             32 cm
/gate/Pat/geometry/setYLength             32 cm
/gate/Pat/geometry/setZLength             32 cm
#Daughter for DICOM
/gate/Pat/daughters/name                       Volume
/gate/Pat/daughters/insert                ImageRegularParametrisedVolume #
     ImageNestedParametrisedVolume
#CoversionFile
/gate/Volume/geometry/setHUToMaterialFile     HUToMat.txt
/gate/Volume/geometry/setImage                      dcm/1.dcm #
/gate/Volume/placement/setRotationAxis          0 -1 0
/gate/Volume/placement/setRotationAngle         90 deg
/gate/Volume/setSkipEqualMaterials   1

#SIMPLEDOSEActor
/gate/actor/addActor
 DoseActor  doseDistribution_text
/gate/actor/doseDistribution_text/save
Dose_Map_Energy_MeV_1D_5material.root
/gate/actor/doseDistribution_text/attachTo              Volume
/gate/actor/doseDistribution_text/stepHitType           random
/gate/actor/doseDistribution_text/setSize               300 300 300 mm
/gate/actor/doseDistribution_text/setResolution         1280 1 1
/gate/actor/doseDistribution_text/enableEdep            true
/gate/actor/doseDistribution_text/enableUncertaintyEdep true
/gate/actor/doseDistribution_text/enableDose            true
/gate/actor/doseDistribution_text/enableUncertaintyDose true
/gate/actor/doseDistribution_text/enableNumberOfHits    true

#PhysicsList
/gate/physics/addPhysicsList QGSP_BIC_HP_EMZ
#Cuts
/gate/physics/Gamma/SetCutInRegion     world 10 mm
/gate/physics/Electron/SetCutInRegion    world 10 mm
/gate/physics/Positron/SetCutInRegion    world 10 mm
/gate/physics/Proton/SetCutInRegion       world 10 mm
/gate/physics/Gamma/SetCutInRegion     Pat 1 mm
/gate/physics/Electron/SetCutInRegion    Pat 1 mm
/gate/physics/Positron/SetCutInRegion    Pat 1 mm
/gate/physics/Proton/SetCutInRegion       Pat 1 mm
/gate/physics/SetMaxStepSizeInRegion    Pat 1 mm
/gate/physics/ActivateStepLimiter proton
/gate/physics/displayCuts

/gate/run/initialize
/gate/random/setEngineName MersenneTwister
/gate/random/setEngineSeed auto
#Source
/gate/source/addSource PBS PencilBeam
/gate/source/PBS/setParticleType proton
/gate/source/PBS/setEnergy 90 MeV
/gate/source/PBS/setSigmaEnergy .88 MeV
/gate/source/PBS/setPosition 0 0 -36.5 cm
/gate/source/PBS/setSigmaX 3.0 mm
/gate/source/PBS/setSigmaY 3.0 mm
#/gate/source/PBS/setRotationAxis 0 1 0
#/gate/source/PBS/setRotationAngle 90 deg
/gate/source/PBS/setSigmaTheta 20 mrad
/gate/source/PBS/setSigmaPhi   20 mrad
/gate/source/PBS/setEllipseXThetaEmittance 40 mm*mrad #40 mm*mrad, 2mm*mrad
/gate/source/PBS/setEllipseYPhiEmittance   40 mm*mrad #40 mm*mrad, 2mm*mrad
/gate/source/PBS/setEllipseXThetaRotationNorm positive
/gate/source/PBS/setEllipseYPhiRotationNorm   positive
/gate/application/setTotalNumberOfPrimaries 1000
/gate/application/start

I have dumped this file into a single density (.mhd +.raw) format
and tried to read it from a single density file but it has no difference in
performance. Below is the information in the header file.
ObjectType = Image
NDims = 3
BinaryData = True
BinaryDataByteOrderMSB = False
CompressedData = False
TransformMatrix = 1 0 0 0 1 0 0 0 1
Offset = -151.494 -36.6564 1115
CenterOfRotation = 0 0 0
ElementSpacing = 0.589844 0.589844 0.5
DimSize = 512 512 361
AnatomicalOrientation = ???
ElementType = MET_FLOAT
ElementDataFile = density-ffs-dcm_5mat.raw
Please ask me for any further details if you feel anything ambiguous.
Your suggestions and solutions are needed. Thank you in advance!
Regards
Atiq


On Fri, Jul 9, 2021 at 4:54 AM <
gate-users-request at lists.opengatecollaboration.org> wrote:

> Send Gate-users mailing list submissions to
>         gate-users at lists.opengatecollaboration.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://lists.opengatecollaboration.org/mailman/listinfo/gate-users
> or, via email, send a message with subject or body 'help' to
>         gate-users-request at lists.opengatecollaboration.org
>
> You can reach the person managing the list at
>         gate-users-owner at lists.opengatecollaboration.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Gate-users digest..."
>
>
> Today's Topics:
>
>    1. Dose calculation for a CT based voxelized Phantom for     Proton
>       beam (Atiq Ur Rahman)
>    2. Re: (Reproduce my problem) (Atiq Ur Rahman)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 8 Jul 2021 04:05:23 +0200
> From: Atiq Ur Rahman <atiqchep at gmail.com>
> To: gate-users at lists.opengatecollaboration.org
> Subject: [Gate-users] Dose calculation for a CT based voxelized
>         Phantom for     Proton beam
> Message-ID:
>         <CAEQ5BgcpvqOn1wL9PXnKCFOQXCwke4m=
> AYTO16REJ1A1rAbVyg at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Dear Gate users,
> I am trying to calculate the dose for the CT based Phantom (512x512x361
> matrix) using a proton beam. I read dicom images directly and define the HU
> to material conversion file.  I am using the vGate.8 virtual machine.
> *Problem:* If I define only three materials (vacuum, Air and
> TissueEquivalent ) the simulation gives output for 1000 primaries very fast
> in a couple of seconds and I can get the output. But if I define one extra
> material (any material, I have tried different materials) , let say
> (Vacuum, Air, TissueEquvalent, Liver)  the simulation runs for a very very
> long time even for 1 primary particle (Actually does not finish even in 10
> hours). Can you give me some suggestions to fix the problem. What is the
> possible cause of the problem? There seems to be something wrong with my
> approach. I have shared my code below.  I have 306 Dicom images put in a
> single directory.
> Definition of the HUToMat.txt
>
> -2000 -800   Vacuum
> -800  -40    Air
> -40    200   Blood
> 200    19000 TissueEquivalent
>
> #CODE
> /
>
> *control/execute mac/verbose.mac/gate/geometry/setMaterialDatabase
>  data/GateMaterials.db*
>
> *#WorldVolume*
>
>
>
>
>
>
>
>
>
> */gate/world/setMaterial
> Vacuum/gate/world/geometry/setXLength           100
> cm/gate/world/geometry/setYLength           100
> cm/gate/world/geometry/setZLength           100
> cm/gate/world/daughters/name
> Pat/gate/world/daughters/insert
> box/gate/Pat/geometry/setXLength             32
> cm/gate/Pat/geometry/setYLength             32
> cm/gate/Pat/geometry/setZLength             32 cm*
>
> *#Daughter for DICOM*
>
>
> */gate/Pat/daughters/name
> Volume/gate/Pat/daughters/insert
>  ImageRegularParametrisedVolume #      ImageNestedParametrisedVolume *
>
> *#CoversionFile*
> */gate/Volume/geometry/setHUToMaterialFile       data/HUToMat.txt *
>
>
>
>
> */gate/Volume/geometry/setImage              New_CODE/data/dcm/1.dcm
> #/gate/Volume/placement/setRotationAxis          0 -1
> 0/gate/Volume/placement/setRotationAngle         90
> deg/gate/Volume/setSkipEqualMaterials   1*
>
>
> *#SIMPLEDOSEActor*
>
>
>
>
>
>
>
>
>
>
> */gate/actor/addActor
> DoseActor  doseDistribution_text/gate/actor/doseDistribution_text/save
>
>
>  output/Dose_Map_Energy_MeV_1D_5material.root/gate/actor/doseDistribution_text/attachTo
>              Volume
> #PMMA_Block/gate/actor/doseDistribution_text/stepHitType
> random/gate/actor/doseDistribution_text/setSize               300 300 300
> mm/gate/actor/doseDistribution_text/setResolution         1280 1
> 1/gate/actor/doseDistribution_text/enableEdep
>  true/gate/actor/doseDistribution_text/enableUncertaintyEdep
> true/gate/actor/doseDistribution_text/enableDose
>  true/gate/actor/doseDistribution_text/enableUncertaintyDose
> true/gate/actor/doseDistribution_text/enableNumberOfHits    true*
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *#PhysicsList/gate/physics/addPhysicsList
> QGSP_BIC_HP_EMZ#Cuts/gate/physics/Gamma/SetCutInRegion     world 10
> mm/gate/physics/Electron/SetCutInRegion    world 10
> mm/gate/physics/Positron/SetCutInRegion    world 10
> mm/gate/physics/Proton/SetCutInRegion       world 10
> mm/gate/physics/Gamma/SetCutInRegion     Pat 1
> mm/gate/physics/Electron/SetCutInRegion    Pat 1
> mm/gate/physics/Positron/SetCutInRegion    Pat 1
> mm/gate/physics/Proton/SetCutInRegion       Pat 1
> mm/gate/physics/SetMaxStepSizeInRegion    Pat 1
> mm/gate/physics/ActivateStepLimiter proton/gate/physics/displayCuts*
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> */gate/run/initialize/gate/random/setEngineName
> MersenneTwister/gate/random/setEngineSeed auto#Source/gate/source/addSource
> PBS PencilBeam/gate/source/PBS/setParticleType
> proton/gate/source/PBS/setEnergy 90 MeV/gate/source/PBS/setSigmaEnergy .88
> MeV/gate/source/PBS/setPosition 0 0 -36.5 cm /gate/source/PBS/setSigmaX 3.0
> mm /gate/source/PBS/setSigmaY 3.0 mm #/gate/source/PBS/setRotationAxis 0 1
> 0#/gate/source/PBS/setRotationAngle 90 deg/gate/source/PBS/setSigmaTheta 20
> mrad/gate/source/PBS/setSigmaPhi   20 mrad
> /gate/source/PBS/setEllipseXThetaEmittance 40 mm*mrad #40 mm*mrad,
> 2mm*mrad/gate/source/PBS/setEllipseYPhiEmittance   40 mm*mrad #40 mm*mrad,
> 2mm*mrad#positive-> converging beam; negative diverging
> beam/gate/source/PBS/setEllipseXThetaRotationNorm
> positive/gate/source/PBS/setEllipseYPhiRotationNorm
> positive/gate/application/setTotalNumberOfPrimaries 1000
> /gate/application/start*
>
> *I have dumped this file into single density (.mhd +.raw) format and tried
> to read it from a single density file but it has no difference in
> performance. Below is the information in the header file.*
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *ObjectType = ImageNDims = 3BinaryData = TrueBinaryDataByteOrderMSB =
> FalseCompressedData = FalseTransformMatrix = 1 0 0 0 1 0 0 0 1Offset =
> -151.494 -36.6564 1115CenterOfRotation = 0 0 0ElementSpacing = 0.589844
> 0.589844 0.5DimSize = 512 512 361AnatomicalOrientation = ???ElementType =
> MET_FLOATElementDataFile = density-ffs-dcm_5mat.raw*
>
> *Please ask me any further details if you feel anything ambiguous.  Your
> suggestions and solutions are needed. Thank you in advance!*
> *Regards*
>
> *Atiq*
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.opengatecollaboration.org/pipermail/gate-users/attachments/20210708/cd7c50c1/attachment-0001.html
> >
>
> ------------------------------
>
> Message: 2
> Date: Thu, 8 Jul 2021 04:46:15 +0200
> From: Atiq Ur Rahman <atiqchep at gmail.com>
> To: gate-users at lists.opengatecollaboration.org
> Subject: Re: [Gate-users] (Reproduce my problem)
> Message-ID:
>         <CAEQ5BgcDHXXqf-wu3gK3dFdWPq=_
> yziUZiMMd9ik1D6pcgsvew at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Dear Users,
> Anyone  who wants to reproduce my problem can directly go to google drive.
> Here is the link to the problem.
>
> https://drive.google.com/drive/folders/1r2LPzE7KLZX0-kfVTNaQyWADLgelVdR9?usp=sharing
> Regards
> Atiq
>
> On Thu, Jul 8, 2021 at 4:05 AM Atiq Ur Rahman <atiqchep at gmail.com> wrote:
>
> > Dear Gate users,
> > I am trying to calculate the dose for the CT based Phantom (512x512x361
> > matrix) using a proton beam. I read dicom images directly and define the
> HU
> > to material conversion file.  I am using the vGate.8 virtual machine.
> > *Problem:* If I define only three materials (vacuum, Air and
> > TissueEquivalent ) the simulation gives output for 1000 primaries very
> fast
> > in a couple of seconds and I can get the output. But if I define one
> extra
> > material (any material, I have tried different materials) , let say
> > (Vacuum, Air, TissueEquvalent, Liver)  the simulation runs for a very
> very
> > long time even for 1 primary particle (Actually does not finish even in
> 10
> > hours). Can you give me some suggestions to fix the problem. What is the
> > possible cause of the problem? There seems to be something wrong with my
> > approach. I have shared my code below.  I have 306 Dicom images put in a
> > single directory.
> > Definition of the HUToMat.txt
> >
> > -2000 -800   Vacuum
> > -800  -40    Air
> > -40    200   Blood
> > 200    19000 TissueEquivalent
> >
> > #CODE
> > /
> >
> > *control/execute mac/verbose.mac/gate/geometry/setMaterialDatabase
> >  data/GateMaterials.db*
> >
> > *#WorldVolume*
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > */gate/world/setMaterial
> > Vacuum/gate/world/geometry/setXLength           100
> > cm/gate/world/geometry/setYLength           100
> > cm/gate/world/geometry/setZLength           100
> > cm/gate/world/daughters/name
> > Pat/gate/world/daughters/insert
> > box/gate/Pat/geometry/setXLength             32
> > cm/gate/Pat/geometry/setYLength             32
> > cm/gate/Pat/geometry/setZLength             32 cm*
> >
> > *#Daughter for DICOM*
> >
> >
> > */gate/Pat/daughters/name
> > Volume/gate/Pat/daughters/insert
> >  ImageRegularParametrisedVolume #      ImageNestedParametrisedVolume *
> >
> > *#CoversionFile*
> > */gate/Volume/geometry/setHUToMaterialFile       data/HUToMat.txt *
> >
> >
> >
> >
> > */gate/Volume/geometry/setImage              New_CODE/data/dcm/1.dcm
> > #/gate/Volume/placement/setRotationAxis          0 -1
> > 0/gate/Volume/placement/setRotationAngle         90
> > deg/gate/Volume/setSkipEqualMaterials   1*
> >
> >
> > *#SIMPLEDOSEActor*
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > */gate/actor/addActor
> > DoseActor  doseDistribution_text/gate/actor/doseDistribution_text/save
> >
> >
> output/Dose_Map_Energy_MeV_1D_5material.root/gate/actor/doseDistribution_text/attachTo
> >              Volume
> > #PMMA_Block/gate/actor/doseDistribution_text/stepHitType
> > random/gate/actor/doseDistribution_text/setSize               300 300 300
> > mm/gate/actor/doseDistribution_text/setResolution         1280 1
> > 1/gate/actor/doseDistribution_text/enableEdep
> >  true/gate/actor/doseDistribution_text/enableUncertaintyEdep
> > true/gate/actor/doseDistribution_text/enableDose
> >  true/gate/actor/doseDistribution_text/enableUncertaintyDose
> > true/gate/actor/doseDistribution_text/enableNumberOfHits    true*
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > *#PhysicsList/gate/physics/addPhysicsList
> > QGSP_BIC_HP_EMZ#Cuts/gate/physics/Gamma/SetCutInRegion     world 10
> > mm/gate/physics/Electron/SetCutInRegion    world 10
> > mm/gate/physics/Positron/SetCutInRegion    world 10
> > mm/gate/physics/Proton/SetCutInRegion       world 10
> > mm/gate/physics/Gamma/SetCutInRegion     Pat 1
> > mm/gate/physics/Electron/SetCutInRegion    Pat 1
> > mm/gate/physics/Positron/SetCutInRegion    Pat 1
> > mm/gate/physics/Proton/SetCutInRegion       Pat 1
> > mm/gate/physics/SetMaxStepSizeInRegion    Pat 1
> > mm/gate/physics/ActivateStepLimiter proton/gate/physics/displayCuts*
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > */gate/run/initialize/gate/random/setEngineName
> > MersenneTwister/gate/random/setEngineSeed
> auto#Source/gate/source/addSource
> > PBS PencilBeam/gate/source/PBS/setParticleType
> > proton/gate/source/PBS/setEnergy 90 MeV/gate/source/PBS/setSigmaEnergy
> .88
> > MeV/gate/source/PBS/setPosition 0 0 -36.5 cm /gate/source/PBS/setSigmaX
> 3.0
> > mm /gate/source/PBS/setSigmaY 3.0 mm #/gate/source/PBS/setRotationAxis 0
> 1
> > 0#/gate/source/PBS/setRotationAngle 90 deg/gate/source/PBS/setSigmaTheta
> 20
> > mrad/gate/source/PBS/setSigmaPhi   20 mrad
> > /gate/source/PBS/setEllipseXThetaEmittance 40 mm*mrad #40 mm*mrad,
> > 2mm*mrad/gate/source/PBS/setEllipseYPhiEmittance   40 mm*mrad #40
> mm*mrad,
> > 2mm*mrad#positive-> converging beam; negative diverging
> > beam/gate/source/PBS/setEllipseXThetaRotationNorm
> > positive/gate/source/PBS/setEllipseYPhiRotationNorm
> > positive/gate/application/setTotalNumberOfPrimaries 1000
> > /gate/application/start*
> >
> > *I have dumped this file into single density (.mhd +.raw) format and
> tried
> > to read it from a single density file but it has no difference in
> > performance. Below is the information in the header file.*
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > *ObjectType = ImageNDims = 3BinaryData = TrueBinaryDataByteOrderMSB =
> > FalseCompressedData = FalseTransformMatrix = 1 0 0 0 1 0 0 0 1Offset =
> > -151.494 -36.6564 1115CenterOfRotation = 0 0 0ElementSpacing = 0.589844
> > 0.589844 0.5DimSize = 512 512 361AnatomicalOrientation = ???ElementType =
> > MET_FLOATElementDataFile = density-ffs-dcm_5mat.raw*
> >
> > *Please ask me any further details if you feel anything ambiguous.  Your
> > suggestions and solutions are needed. Thank you in advance!*
> > *Regards*
> >
> > *Atiq*
> >
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.opengatecollaboration.org/pipermail/gate-users/attachments/20210708/1d65cc99/attachment.html
> >
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> Gate-users mailing list
> Gate-users at lists.opengatecollaboration.org
> http://lists.opengatecollaboration.org/mailman/listinfo/gate-users
>
> ------------------------------
>
> End of Gate-users Digest, Vol 182, Issue 6
> ******************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opengatecollaboration.org/pipermail/gate-users/attachments/20210708/b6a77695/attachment-0001.html>


More information about the Gate-users mailing list