1 08/06/ ThIS : a Geant4-based Therapeutic Irradiation Simulator Laurent Guigues CREATIS, UMR CNRS 5220, INSERM U 630 Villeurbanne, France
2 08/06/ Outline Introduction Goal Architecture ThIS modules Physics Geometry Sensors Beam Conclusion
3 08/06/ Goal of the project Rationale : Several radiotherapy studies involve MC simulations Multidisciplinary research (physics, medicine, computer science...) Computer science difficulties (C++) Share development Goal : Monte-Carlo simulation platform for radiation therapy studies Photon, Proton, Carbon Cooperative work Accuracy, speed, ease of use, flexibility, openness...
4 08/06/ Some technical choices Geant4 Extensive and extensible physics C++ Associated with an image library : ThISiS (ThIS image suite) Managing 3D volumes : CT images 3D dose maps ITK-based (Insight Segmentation and Registration Toolkit) Command line only (no display) Documentation wiki, CVS development (cooperative)
5 08/06/ ThIS is easy ! High-level macro language (“à la GATE”) : [Jan et al. 2004] “GATE: a simulation toolkit for PET and SPECT” Phys. Med. Biol. 49 (2004) GATE : Geant4 Application for Tomographic Emission Focused on PET, SPECT simulations ThIS : Therapeutic Irradiation Simulator Focused on radiation therapy simulations
6 08/06/ ThIS is easy ! Running a simulation : ThIS MyBeautifulSimu.mac “/run/beamOn 100”
7 08/06/ /this/physics/Gamma/SetCutInRegion world 10.0 mm /this/physics/Electron/SetCutInRegion waterBox 3.6 mm /this/physics/Positron/SetCutInRegion PMMACone 4.0 cm # A linac /this/scene/addVolume AcceleratorHead linac /this/scene/linac/parent world /this/scene/linac/position cm /this/scene/linac/Target/Diameter5.4 mm /this/scene/linac/Target/Thickness1 mm /this/scene/linac/Target/Material Tungsten /this/scene/linac/PrimaryCollimator/Diameter200 mm /this/scene/linac/PrimaryCollimator/Height101 mm /this/scene/linac/PrimaryCollimator/BaseDiameter62.9 mm /this/scene/addSensor HitsAccumulatorsSensor mySensor /this/scene/mySensor/hitType post /this/scene/mySensor/attach waterBox /this/scene/mySensor/halfsize cm /this/scene/mySensor/resolution /this/scene/mySensor/position cm /this/scene/mySensor/saveEveryNEvents 200 /this/scene/mySensor/baseFilename output.hdr /this/scene/mySensor/Edep/enable 1 /this/scene/mySensor/Edep/uncertainty 1 /this/scene/mySensor/Edep/squared 1 ThIS is easy ! Running a simulation : ThIS MyBeautifulSimu.mac “/run/beamOn 100” File of macros
8 08/06/ /this/physics/Gamma/SetCutInRegion world 10.0 mm /this/physics/Electron/SetCutInRegion waterBox 3.6 mm /this/physics/Positron/SetCutInRegion PMMACone 4.0 cm # A linac /this/scene/addVolume AcceleratorHead linac /this/scene/linac/parent world /this/scene/linac/position cm /this/scene/linac/Target/Diameter5.4 mm /this/scene/linac/Target/Thickness1 mm /this/scene/linac/Target/Material Tungsten /this/scene/linac/PrimaryCollimator/Diameter200 mm /this/scene/linac/PrimaryCollimator/Height101 mm /this/scene/linac/PrimaryCollimator/BaseDiameter62.9 mm /this/scene/addSensor HitsAccumulatorsSensor mySensor /this/scene/mySensor/hitType post /this/scene/mySensor/attach waterBox /this/scene/mySensor/halfsize cm /this/scene/mySensor/resolution /this/scene/mySensor/position cm /this/scene/mySensor/saveEveryNEvents 200 /this/scene/mySensor/baseFilename output.hdr /this/scene/mySensor/Edep/enable 1 /this/scene/mySensor/Edep/uncertainty 1 /this/scene/mySensor/Edep/squared 1 ThIS is easy ! Running a simulation : ThIS MyBeautifulSimu.mac “/run/beamOn 100” File of macros No C++ No compilation No C++ No compilation
9 08/06/ Documentation User's Guide
10 08/06/ Using cuts
11 08/06/ ThIS' Architecture Based on Geant4 classes Extend functionality with ThIS classes intermediate level between Geant4 and the user Provide user macros interaction Geant4 Core Classes ThIS Core Classes ThIS Macros Developer End User script
12 08/06/ ThIS' Architecture ThIS is made up of 5 modules : Simulation Manager : verbosity, display... Physics : particles, processes and models declaration Scene : description of the content of the world : volumes, materials (patient, beam line...) Beam : description of the particle beam : type of particles, energy spectrum, shape of the beam... Sensors : information that you wish to gather during the simulation (e.g. #of neutrons created in a given volume, spectrum of the gammas produced, energy deposited in some region...). Sensors are activated by Triggers. (similar to G4 Scorers and Filters) Volume 1 Sensor 1 Trigger Physics world Volume n Sensor m … … Beam
13 08/06/ Main modules Physics Geometry (scene) Sensors & Triggers Beam Run-time vs Compile-time
14 08/06/ Physics module ThISPhysicsList : Manage 2 main lists : List of groups of particles List of physical processes Associate at run-time one group of particles with a process according to user's choices
15 08/06/ Physics module ThISPhysicsList : Manage 2 main lists : List of groups of particles Groups defined with a predicate Can have n particules (including 1) List of physical processes particle->GetParticleName() == “e-” particle->GetPDGCharge() != 0.0
16 08/06/ Physics module ThISPhysicsList : Manage 2 main lists : List of groups of particles List of physical processes A “process” is composed of a name some “models” some parameters Example : Compton Standard = G4ComptonScattering LowEn = G4LowEnergyCompton Penelope = G4PenelopeCompton
17 08/06/ Physics module ThISPhysicsList : Manage 2 main lists : List of groups of particles List of physical processes /this/physics/Gamma/PhotoElectric/lowE /this/physics/Gamma/Compton/lowE /this/physics/Gamma/GammaConversion/lowE /this/physics/Gamma/Rayleigh/lowE /this/physics/Electron/MultipleScattering/standard /this/physics/Electron/eIonisation/lowE /this/physics/Electron/eBremsstrahlung/lowE /this/physics/Positron/MultipleScattering/standard /this/physics/Positron/eIonisation/standard /this/physics/Positron/eBremsstrahlung/standard /this/physics/Positron/eplusAnnihilation/standard
18 08/06/ Physics module ThISPhysicsList : Manage 2 main lists : List of groups of particles List of physical processes /this/physics/Gamma/PhotoElectric/lowE /this/physics/Gamma/Compton/penelope /this/physics/Gamma/GammaConversion/lowE /this/physics/Gamma/Rayleigh/lowE /this/physics/Electron/MultipleScattering/standard /this/physics/Electron/eIonisation/lowE /this/physics/Electron/eBremsstrahlung/lowE /this/physics/Positron/MultipleScattering/standard /this/physics/Positron/eIonisation/standard /this/physics/Positron/eBremsstrahlung/standard /this/physics/Positron/eplusAnnihilation/standard
19 08/06/ Physics module ThISPhysicsList : Some hadronic processes (elastic/inelastic) Not all G4 hadronic processes included (yet) /this/physics/Proton/hadronElastic/standard/LElastic /this/physics/Proton/protonInelastic/standard/BinaryCascade/SetMinEnergy 170 MeV /this/physics/Proton/protonInelastic/standard/BinaryCascade/SetMaxEnergy 500 MeV /this/physics/Proton/protonInelastic/standard/PreCompoundModel/SetMinEnergy 0 MeV /this/physics/Proton/protonInelastic/standard/PreCompoundModel/SetMaxEnergy 170 MeV /this/physics/GenericIon/genericIonInelastic/standard/BinaryLightIonReaction /this/physics/Deuteron/hadronElastic/standard/LElastic /this/physics/Deuteron/hadronFission/standard/LFission /this/physics/Deuteron/deuteronInelastic/standard/BinaryLightIonReaction/SetMinEnergy 80 MeV /this/physics/Deuteron/deuteronInelastic/standard/BinaryLightIonReaction/SetMaxEnergy 20 GeV /this/physics/Deuteron/deuteronInelastic/standard/LEDeuteronInelastic/SetMinEnergy 0 MeV /this/physics/Deuteron/deuteronInelastic/standard/LEDeuteronInelastic/SetMaxEnergy 1000 MeV
20 08/06/ Physics module ThISPhysicsList : Some hadronic processes (elastic/Inelastic) Not all G4 hadronic processes included (yet) Simple mechanism to add processes from G4 (compile-time) to ThIS (run-time)
21 08/06/ Physics module ThISPhysicsList : Some hadronic processes (elastic/Inelastic) Not all G4 hadronic processes included (yet) Simple mechanism to add processes from G4 (compile-time) to ThIS (run-time) // C++ Macros ADD_DISCRETE_PROCESS(ThIS_PhotoElectricEffect_std_PB, PhotoElectric, standard, G4PhotoElectricEffect, ThISPhotonParticlesGroupBuilder);
22 08/06/ Physics module ThISPhysicsList : Some hadronic processes (elastic/Inelastic) Not all G4 hadronic processes included (yet) Simple mechanism to add processes from G4 (compile-time) to ThIS (run-time) // C++ Macros ADD_DISCRETE_PROCESS(ThIS_PhotoElectricEffect_std_PB, PhotoElectric, standard, G4PhotoElectricEffect, ThISPhotonParticlesGroupBuilder); User macro name Group of particle Standard G4 process name
23 08/06/ Physics module ThISPhysicsList : Some hadronic processes (elastic/Inelastic) Not all G4 hadronic processes included (yet) Simple mechanism to add processes from G4 (compile-time) to ThIS (run-time) // C++ Macros ADD_DISCRETE_PROCESS(ThIS_PhotoElectricEffect_std_PB, PhotoElectric, standard, G4PhotoElectricEffect, ThISPhotonParticlesGroupBuilder); User macro name Group of particle
24 08/06/ Physics module ThISPhysicsList : Some hadronic processes (elastic/Inelastic) Not all G4 hadronic processes included (yet) Simple mechanism to add processes from G4 (compile-time) to ThIS (run-time) // C++ Macros ADD_DISCRETE_PROCESS(ThIS_PhotoElectricEffect_std_PB, PhotoElectric, standard, G4PhotoElectricEffect, ThISPhotonParticlesGroupBuilder); User macro name
25 08/06/ Physics module ThISPhysicsList : Output user selected physics /this/physics/particleGroupOutput particles-groups.txt /this/physics/particleOutput particles-list.txt /this/physics/processGroupOutput process-groups.txt /this/physics/processOutput process-list.txt /this/physics/particleProcessOutput particle-process.txt Output available particles/processes at compile-time Output available particles/processes at compile-time
26 08/06/ Physics module ThISPhysicsList : Output user selected physics /this/physics/particleGroupOutput particles-groups.txt /this/physics/particleOutput particles-list.txt /this/physics/processGroupOutput process-groups.txt /this/physics/processOutput process-list.txt /this/physics/particleProcessOutput particle-process.txt Output user enabled particles/processes at run-time
27 08/06/ Physics module Gamma (1) : gamma Electron (1) : e- Positron (1) : e+ Neutron (1) : neutron GenericIon (1) : GenericIon Proton (1) : proton Ions (4) : He3 alpha deuteron triton Baryons (32) : anti_lambda anti_lambda_c+ anti_neutron... Mesons (24) : B+ B- B0 Bs0 D+ D- D0 Ds+ Ds- J/psi anti_B0... Leptons (12) : anti_nu_e anti_nu_mu anti_nu_tau e+ e- mu+... Deuteron (1) : deuteron Triton (1) :triton Alpha (1) : alpha He3 (1) : He3 HadronElasticApplicable (28) : alpha anti_lambda anti_neutron... IonIonisationApplicable (5) : GenericIon He3 alpha deuteron... ChargedAndNotShortLived (39) : B+ B- D+ D- Ds+ Ds- GenericIon Example of some available groups of particles
28 08/06/ Physics module PhotoElectric-standard : gamma PhotoElectric-lowE : gamma PhotoElectric-penelope : gamma Compton-std : gamma Compton-lowE : gamma Compton-penelope : gamma Rayleigh-lowE : gamma Rayleigh-penelope : gamma MultipleScattering-standard : B+ B- D+ D- Ds+ Ds- GenericIon He3 alpha... eIonisation-standard : e+ e- eIonisation-lowE : e- eIonisation-penelope : e+ e- eBremsstrahlung-standard : e+ e- eBremsstrahlung-lowE : e- eBremsstrahlung-penelope : e+ e- eplusAnnihilation-standard : e+ eplusAnnihilation-penelope : e+ ionIonisation-standard : GenericIon He3 alpha deuteron triton hadronIonisation-standard : B+ B- D+ D- Ds+ Ds- GenericIon He3 alpha... genericIonInelastic-standard : GenericIon neutronInelastic-standard : neutron deuteronInelastic-standard : deuteron tritonInelastic-standard : triton alphaInelastic-standard : alpha He3Inelastic-standard : He3 protonInelastic-standard : proton Example of some available processes
29 08/06/ Physics module GenericIon : MultipleScattering-standard ionIonisation-standard genericIonInelastic-standard(BinaryLightIonReaction[min=def,max=def]) deuteron : MultipleScattering-standard ionIonisation-standard hadronElastic- standard(LElastic[min=def,max=def]) hadronFission- standard(LFission[min=def,max=def]) deuteronInelastic- standard(BinaryLightIonReaction[min=80,max=20000]LEDeuteronInelastic[min=0,max=10 00]) e+ : MultipleScattering-standard eIonisation-standard eBremsstrahlung-standard eplusAnnihilation-standard e- : MultipleScattering-standard eIonisation-lowE eBremsstrahlung-lowE gamma : PhotoElectric-lowE Compton-lowE GammaConversion-lowE Rayleigh-lowE neutron : hadronElastic-standard(LEpp[min=def,max=def]) hadronNeutronCapture- standard(LCapture[min=def,max=def]) hadronFission- standard(LFission[min=def,max=def]NeutronHPFission[min=def,max=def]) proton : MultipleScattering-standard hadronIonisation-ziegler2000 hadronElastic- standard(LElastic[min=def,max=def]) protonInelastic- standard(BinaryCascade[min=170,max=500]PreCompoundModel[min=0,max=170]) Example of some user selected processes
30 08/06/ Physics module ThISPhysicsList : Still several G4 processes to be added But the main mechanisms exist Collaborative work based on user interest principle : If you need it : add it So : everyone can use it Drawback : No checking of the physics list validity (except IsApplicable from G4)
31 08/06/ Cuts Setting cuts in ThIS Production cuts MaxStepLimiter “cuts” Killing cuts /this/physics/Gamma/SetCutInRegion world 10.0 mm /this/physics/Electron/SetCutInRegion waterBox 3.6 mm /this/physics/Positron/SetCutInRegion PMMACone 4.0 cm
32 08/06/ Cuts Setting cuts in ThIS Production cuts MaxStepLimiter “cuts” Killing cuts /this/physics/Gamma/SetCutInRegion world 10.0 mm /this/physics/Electron/SetCutInRegion waterBox 3.6 mm /this/physics/Positron/SetCutInRegion PMMACone 4.0 cm Previously user defined volumes
33 08/06/ Cuts Setting cuts in ThIS Production cuts MaxStepLimiter “cuts” Killing cuts /this/physics/UserLimits/SetMaxAllowedStep world 2 mm /this/physics/UserLimits/SetMaxAllowedStep waterBox 1 mm /this/physics/Electron/StepLimiter/standard /this/physics/Gamma/StepLimiter/standard
34 08/06/ Cuts Setting cuts in ThIS Production cuts MaxStepLimiter “cuts” Killing cuts /this/physics/UserLimits/SetMaxAllowedStep world 2 mm /this/physics/UserLimits/SetMaxAllowedStep waterBox 1 mm /this/physics/Electron/StepLimiter/standard /this/physics/Gamma/StepLimiter/standard MaxStep limiter for each region, for each particle
35 08/06/ Cuts Setting cuts in ThIS Production cuts MaxStepLimiter “cuts” Killing cuts /this/physics/UserLimits/SetUserMinRange waterBox 0.1mm /this/physics/UserLimits/SetUserMinRange world 1mm /this/physics/UserLimits/SetUserMinEkine waterBox 10keV /this/physics/UserLimits/SetUserMinEkine world 100keV /this/physics/Electron/UserSpecialCuts/standard
36 08/06/ Cuts Setting cuts in ThIS Production cuts MaxStepLimiter “cuts” Killing cuts /this/physics/UserLimits/SetUserMinRange waterBox 0.1mm /this/physics/UserLimits/SetUserMinRange world 1mm /this/physics/UserLimits/SetUserMinEkine waterBox 10keV /this/physics/UserLimits/SetUserMinEkine world 100keV /this/physics/Electron/UserSpecialCuts/standard “Kill” particle according to range/energy threshold
37 08/06/ Main modules Physics Geometry (scene) Sensors & Triggers Beam Run-time vs Compile-time
38 08/06/ Main modules Physics Geometry (scene) Sensors & Triggers Beam Run-time vs Compile-time
39 08/06/ #================================================= # World volume /this/scene/addVolume Box world /this/scene/world/halfsize m /this/scene/world/material_name Air #================================================= # A water box /this/scene/addVolume Box waterBox /this/scene/waterBox/parent world /this/scene/waterBox/position cm /this/scene/waterBox/halfsize cm /this/scene/waterBox/material_name Water Scene module ThISDetectorConstructor : Dynamic (run-time) scene description Add volumes Set properties (position, material...) Volume type Volume name
40 08/06/ Scene module ThISDetectorConstructor : Some G4 simple shapes (Box, Cone...) #================================================= # A PMMA cone /this/scene/addVolume Cone PMMACone /this/scene/PMMACone/parent world /this/scene/PMMACone/position cm /this/scene/PMMACone/rmin10 cm /this/scene/PMMACone/rmax13.7 cm /this/scene/PMMACone/rmin20 cm /this/scene/PMMACone/rmax20 cm /this/scene/PMMACone/dz78 mm /this/scene/PMMACone/sphi0 deg /this/scene/PMMACone/dphi22 deg /this/scene/PMMACone/material_name PMMA Volume type Volume name
41 08/06/ Scene module ThISDetectorConstructor : Some G4 simple shapes (Box, Cone...) Complex user defined shapes (in progress) #================================================= # An linac /this/scene/addVolume AcceleratorHead linac /this/scene/linac/parent world /this/scene/linac/position cm /this/scene/linac/Target/Diameter5.4 mm /this/scene/linac/Target/Thickness1 mm /this/scene/linac/Target/Material Tungsten /this/scene/linac/PrimaryCollimator/Diameter200 mm /this/scene/linac/PrimaryCollimator/Height101 mm /this/scene/linac/PrimaryCollimator/BaseDiameter62.9 mm /this/scene/linac/FlatteningFilter/ConeDiameter 54.4 mm... Volume type Volume name
42 08/06/2007
43 08/06/ Scene module ThISDetectorConstructor : Some G4 simple shapes (Box, Cone...) Complex user defined shapes (in progress) #================================================= # An linac /this/scene/addVolume AcceleratorHead linac /this/scene/linac/parent world /this/scene/linac/position cm /this/scene/linac/Target/Diameter5.4 mm /this/scene/linac/Target/Thickness1 mm /this/scene/linac/Target/Material Tungsten /this/scene/linac/PrimaryCollimator/Diameter200 mm /this/scene/linac/PrimaryCollimator/Height101 mm /this/scene/linac/PrimaryCollimator/BaseDiameter62.9 mm /this/scene/linac/FlatteningFilter/ConeDiameter 54.4 mm... Volume type Volume name
44 08/06/ Scene module ThISDetectorConstructor : Some G4 simple shapes (Box, Cone...) Complex user defined shapes (in progress) #================================================= # An linac /this/scene/addVolume AcceleratorHead linac /this/scene/linac/parent world /this/scene/linac/position cm /this/scene/linac/Target/Diameter5.4 mm /this/scene/linac/Target/Thickness1 mm /this/scene/linac/Target/Material Tungsten /this/scene/linac/PrimaryCollimator/Diameter200 mm /this/scene/linac/PrimaryCollimator/Height101 mm /this/scene/linac/PrimaryCollimator/BaseDiameter62.9 mm /this/scene/linac/FlatteningFilter/ConeDiameter 54.4 mm... Volume type Volume name
45 08/06/ Scene module ThISDetectorConstructor : Some G4 simple shapes (Box, Cone...) Complex user defined shapes (in progress) #================================================= # An linac /this/scene/addVolume AcceleratorHead linac /this/scene/linac/parent world /this/scene/linac/position cm /this/scene/linac/Target/Diameter5.4 mm /this/scene/linac/Target/Thickness1 mm /this/scene/linac/Target/Material Tungsten /this/scene/linac/PrimaryCollimator/Diameter200 mm /this/scene/linac/PrimaryCollimator/Height101 mm /this/scene/linac/PrimaryCollimator/BaseDiameter62.9 mm /this/scene/linac/FlatteningFilter/ConeDiameter 54.4 mm... Volume type Volume name
46 08/06/ Scene module ThISDetectorConstructor : Some G4 simple shapes (Box, Cone...) Complex user defined shapes (in progress) Simple mechanism to add volumes from G4 (compile-time) to ThIS (run-time) Collaborative work based on user’s interest principle : If you need it : add it So : everyone can use it
47 08/06/ Scene module /this/scene/object /this/scene/object/parent /this/scene/addVolume /this/scene/object/material /this/scene/object/position /this/scene/object/rotation /this/scene/object/halfsize
48 08/06/ Scene module class ThISBoxVolume : public ThISVolume { public: ThISBoxVolume(ThISDetectorConstruction* dc, G4String path, G4String name); ~ThISBoxVolume(); THISMACRO_INIT_VOLUME_CREATOR(ThISBoxVolume); virtual G4String GetTypeName() { return "Box";} virtual void ConstructSolid(); void SetHalfSize(G4ThreeVector v) { mHalfSize = v; } G4ThreeVector GetHalfSize() const { return mHalfSize; } void PrintInfo(); protected: ThISBoxVolumeMessenger *pMessenger; G4ThreeVector mHalfSize; ThISBoxVolume(); };
49 08/06/ Scene module //============================================================ ThISBoxVolume::ThISBoxVolume ( ThISDetectorConstruction* dc, G4String path, G4String name ) : ThISVolume(dc,path,name) { mHalfSize = G4ThreeVector(0.5*m, 0.5*m, 0.5*m); pMessenger = new ThISBoxVolumeMessenger(this); } //============================================================ ThISBoxVolume::ThISBoxVolume() : pMessenger(0) {} //============================================================ ThISBoxVolume::~ThISBoxVolume() { if (pMessenger) delete pMessenger; } //============================================================ void ThISBoxVolume::ConstructSolid() { G4String solidName = GetInstanceName()+"_solid"; SetSolid ( new G4Box (solidName, mHalfSize.x(), mHalfSize.y(), mHalfSize.z()) ); } //============================================================ void ThISBoxVolume::PrintInfo() { ThISVolume::PrintInfo(); std::cout << "\t HalfSize = " << G4BestUnit(GetHalfSize(),"Length") << std::endl; } //============================================================ From ThISNamedObject From ThISVolume
50 08/06/ Scene module class ThISBoxVolumeMessenger: public ThISVolumeMessenger { public: ThISBoxVolumeMessenger ( ThISBoxVolume* box ); ~ThISBoxVolumeMessenger(); void SetNewValue ( G4UIcommand*, G4String ); protected: ThISBoxVolume * boxVolume; G4UIcmdWith3VectorAndUnit *halfsizeCmd; }; //=============================================================== ThISBoxVolumeMessenger::ThISBoxVolumeMessenger ( ThISBoxVolume* box ) : ThISVolumeMessenger(box), boxVolume(box) { G4String name = boxVolume->GetInstanceName(); G4String path = boxVolume->GetPath(); G4String n = path+"/halfsize"; halfsizeCmd = new G4UIcmdWith3VectorAndUnit(n, this); halfsizeCmd->SetGuidance(G4String("Set "+name+"’s size")); halfsizeCmd->SetDefaultUnit("cm"); } //=============================================================== void ThISBoxVolumeMessenger::SetNewValue ( G4UIcommand* command, G4String newValue ) { if ( command == halfsizeCmd ) boxVolume->SetHalfSize(halfsizeCmd->GetNew3VectorValue(newValue)); else ThISVolumeMessenger::SetNewValue(command,newValue); }
51 08/06/ Scene module ThISDetectorConstructor : Some G4 simple shapes (Box, Cone...) Complex user defined shapes (in progress) Simple mechanism to add volumes from G4 (compile-time) to ThIS (run-time) Collaborative work based on user’s interest principle : If you need it : add it So : everyone can use it Materials : Re-use the Material Database mechanism from Gate (enhanced to allow multiple Dbs) /this/scene/materialDatabase StandardMaterials.db /this/scene/materialDatabase PhantomMaterials.db
52 08/06/ Scene module ThISDetectorConstructor : Easy to add elements/materials [Elements] Hydrogen: S= H ; Z= 1. ; A= 1.01 g/mole Helium: S= He ; Z= 2. ; A= g/mole Carbon: S= C ; Z= 6. ; A= g/mole Nitrogen: S= N ; Z= 7. ; A= g/mole [Materials] PMMA:d=1.195 g/cm3; n=3 ; state=Solid +el: name=Hydrogen ; f= el: name=Carbon ; f= el: name=Sulfur; f= Gadox:d=7.23 g/cm3; n=4 ; state=Solid +el: name=Gadolinium ; f= el: name=Sulfur ; f= el: name=Oxygen; f= el: name=Terbium; f=0.003 GateMaterials.db
53 08/06/ Scene module ThISDetectorConstructor : Insert CT image in simulation CT slices Geant4 / ThIS
54 08/06/ Scene module Insert images in simulation 1. Transform CT image into composition image 1. Calibrate Scanner using phantom [schneider et al. 2000] 2. Transform CT image : => image of labels + label to material table => Provided in ThISiS 1. Insert label image in G4 simulation
55 08/06/ Scene module Insert images in simulation 1 G4Box per voxel !! High memory cost : not feasible in real-world cases ParametrisedVolume / NestedParametrisedVolume Low memory cost, G4 state-of-the-art, Time consuming Two ways to reduce time 1) Reduce image complexity 2) Change G4 navigation algorithm
56 08/06/ Scene module Insert images in simulation 1) Reduce image complexity 2) Change G4 navigation algorithm
57 08/06/ Scene module Insert images in simulation 1) Reduce image complexity Voxels
58 08/06/ Scene module Insert images in simulation 1) Reduce image complexity Merge adjacent voxels having similar materials : Image Segmentation problem Voxels
59 08/06/ Scene module Insert images in simulation 1) Reduce image complexity Merge adjacent voxels having similar materials : Image Segmentation problem a) Isothetic Volume : Segment image in parallelepipeds (G4Box) Special case : Octree segmentation [Hubert-Tremblay et al. 2006] Isothetic Octree Voxels
60 08/06/ Scene module Insert images in simulation 1) Reduce image complexity Merge adjacent voxels having similar materials : Image Segmentation problem a) Isothetic Volume : Segment image in parallelepipeds (G4Box) Special case : Octree segmentation [Hubert-Tremblay et al. 2006] b) Regionalised Volume : arbitrary shape [Sarrut and Guigues subm.] Isothetic Octree Voxels Regions
61 08/06/ Scene module Insert images in simulation 1) Reduce image complexity Merge adjacent voxels having similar materials : Image Segmentation problem Segmentation methods available in ThISiS Isothetic Octree Voxels Regions
62 08/06/ Scene module Insert images in simulation 1) Reduce image complexity Available image representations in ThIS : - ImageBoxes (multiple G4Box) - ImageParameterised (G4VParameterisedVolume) - ImageNestedParameterised (G4VNestedParam...Volume) - ImageIsothetic - ImageRegionalised Isothetic Octree Voxels Regions
63 08/06/ Scene module Insert images in simulation Image volumes Label image (Analyze, raw formats...) Label to material information /this/scene/addVolume ImageBoxes patient /this/scene/patient/parent world /this/scene/patient/imagelung.hdr /this/scene/patient/materials lung.lab2mat
64 08/06/ Scene module Insert images in simulation Image volumes Label image (Analyze, raw formats...) Label to material information /this/scene/addVolume ImageBoxes patient /this/scene/patient/parent world /this/scene/patient/imagelung.hdr /this/scene/patient/materials lung.lab2mat Volume type Volume name
65 08/06/ Scene module Insert images in simulation Image volumes Label image (Analyze, raw formats...) Label to material information /this/scene/addVolume ImageBoxes patient /this/scene/patient/parent world /this/scene/patient/imagelung.hdr /this/scene/patient/materials lung.lab2mat Volume type Volume name
66 08/06/ Scene module Insert images in simulation Image volumes Label image (Analyze, raw formats...) Label to material information /this/scene/addVolume ImageBoxes patient /this/scene/patient/parent world /this/scene/patient/imagelung.hdr /this/scene/patient/materials lung.lab2mat Volume type Volume name 0 Air 1 Lung 2 SoftTissue... 8 ConnectiveTissue 9 Bone_1 10 Bone_2...
67 08/06/ Scene module Results Octree Arbitrary regions
68 08/06/ Scene module Results
69 08/06/ Scene module Results Speed up (time NPV / time RV) Dose difference RV-NPV (%)
70 08/06/ Scene module Insert images in simulation 1) Reduce image complexity 2) Change G4 navigation algorithm
71 08/06/ Scene module Insert images in simulation 1) Reduce image complexity 2) Change G4 navigation algorithm [Jiang & Paganetti 2004] : in progress
72 08/06/ Scene module Image volumes : Tradeoff : Accuracy / Speed Large number of regions : small compression, slow simulation good accuracy Small number of regions : good compression, fast simulation low accuracy Still a lot to of work to be done
73 08/06/ Scene module ThISDetectorConstructor : Done : main mechanism simple base shapes / complex volumes To do : Boolean operations Add other shapes Image volumes Associated image preparation tools (ThISiS) Calibration Segmentation Optimized volumes ImageIsothetic (octree segmented images) ImageRegionalised (segmented images) Optimized navigator : in progress
74 08/06/ Main modules Physics Geometry (scene) Sensors & Triggers Beam Run-time vs Compile-time
75 08/06/ Main modules Physics Geometry (scene) Sensors & Triggers Beam Run-time vs Compile-time
76 08/06/ Sensor module ThISSensor ThIS DOES NOT use the G4SensitiveDetector mechanism Sensor = measure/display Something : dose deposit (uncertainty), number of B+ emitters... Somewhere : globally, in a volume, surface... Sometimes : at the end of the simulation, at each track, at each steps, every n events...
77 08/06/ Sensors module Triggers All sensors can be associated with a trigger : Including, excluding particle from a measurement Sorting on energy... /this/scene/addTrigger ParticleName T2 /this/scene/T2/include all /this/scene/T2/exclude e- /this/scene/T2/exclude gamma /this/scene/T2/exclude proton /this/scene/addTrigger ParticleEnergy T3 /this/scene/T3/energyMin 100 keV /this/scene/T3/energyMax 10 TeV /this/scene/addTrigger And T4 /this/scene/T4/add T2 /this/scene/T4/add T3 /this/scene/ANYSENSOR/trigger T4
78 08/06/ Sensors module Triggers All sensors can be associated with a trigger : Including, excluding particle from a measurement Sorting on energy... /this/scene/addTrigger ParticleName T2 /this/scene/T2/include all /this/scene/T2/exclude e- /this/scene/T2/exclude gamma /this/scene/T2/exclude proton /this/scene/addTrigger ParticleEnergy T3 /this/scene/T3/energyMin 100 keV /this/scene/T3/energyMax 10 TeV /this/scene/addTrigger And T4 /this/scene/T4/add T2 /this/scene/T4/add T3 /this/scene/ANYSENSOR/trigger T4 All particles except e-, gamma, proton
79 08/06/ Sensors module Triggers All sensors can be associated with a trigger : Including, excluding particle from a measurement Sorting on energy... /this/scene/addTrigger ParticleName T2 /this/scene/T2/include all /this/scene/T2/exclude e- /this/scene/T2/exclude gamma /this/scene/T2/exclude proton /this/scene/addTrigger ParticleEnergy T3 /this/scene/T3/energyMin 100 keV /this/scene/T3/energyMax 10 TeV /this/scene/addTrigger And T4 /this/scene/T4/add T2 /this/scene/T4/add T3 /this/scene/ANYSENSOR/trigger T4 With energy in this range
80 08/06/ Sensors module ThISSensor Two examples of sensors : Particles counter Dose sensor (energy deposited + uncertainty)
81 08/06/ Sensors module ThISParticleCounter /this/scene/addSensorParticleCounter MyCounter /this/scene/MyCounter/trackpre /this/scene/MyCounter/attach waterBox /this/scene/MyCounter/verbose/event 1 Sensor type Sensor name
82 08/06/ Sensors module > ThIS MySimu.mac “/run/beamOn 5” R1 ****************** Begin of run 1 ******************** B1 ======= Generating particle 1======= B2 _ (1) C12[0.0] pos.=( , ,0) energy=2640 dir.=(0,-1,0) T0 C GeV 0 fm T0 C eV 15.1 cm T0 e keV 0 fm ionIoni T0 e eV mum ionIoni T0 e keV 0 fm ionIoni T0 e eV mum ionIoni T0 e keV 0 fm ionIoni T0 e MeV 0 fm LowEnConversion T0 e eV 4.4 cm LowEnConversion T0 e eV 2.2 mm ionIoni T0 e eV mum ionIoni T0 gamma keV 0 fm LowEnBrem T0 gamma eV 9.2mum LowEnBrem T0 e keV 0 fm LowEnPhotoElec T0 e eV 1.4mm LowEnPhotoElec T0 e keV 0 fm ionIoni Output Kinetic energy
83 08/06/ Sensors module > ThIS MySimu.mac “/run/beamOn 5” R1 ****************** Begin of run 1 ******************** B1 ======= Generating particle 1======= B2 _ (1) C12[0.0] pos.=( , ,0) energy=2640 dir.=(0,-1,0) T0 C GeV 0 fm T0 C eV 15.1 cm T0 e keV 0 fm ionIoni T0 e eV mum ionIoni T0 e keV 0 fm ionIoni T0 e eV mum ionIoni T0 e keV 0 fm ionIoni T0 e MeV 0 fm LowEnConversion T0 e eV 4.4 cm LowEnConversion T0 e eV 2.2 mm ionIoni T0 e eV mum ionIoni T0 gamma keV 0 fm LowEnBrem T0 gamma eV 9.2mum LowEnBrem T0 e keV 0 fm LowEnPhotoElec T0 e eV 1.4mm LowEnPhotoElec T0 e keV 0 fm ionIoni Output Track length
84 08/06/ Sensors module > ThIS MySimu.mac “/run/beamOn 5” R1 ****************** Begin of run 1 ******************** B1 ======= Generating particle 1======= B2 _ (1) C12[0.0] pos.=( , ,0) energy=2640 dir.=(0,-1,0) T0 C GeV 0 fm T0 C eV 15.1 cm T0 e keV 0 fm ionIoni T0 e eV mum ionIoni T0 e keV 0 fm ionIoni T0 e eV mum ionIoni T0 e keV 0 fm ionIoni T0 e MeV 0 fm LowEnConversion T0 e eV 4.4 cm LowEnConversion T0 e eV 2.2 mm ionIoni T0 e eV mum ionIoni T0 gamma keV 0 fm LowEnBrem T0 gamma eV 9.2mum LowEnBrem T0 e keV 0 fm LowEnPhotoElec T0 e eV 1.4mm LowEnPhotoElec T0 e keV 0 fm ionIoni Output Creator process
85 08/06/ Example B B B12 8 B13 15 B14 1 B15 1 B5 1 B9 28 C10112 C11780 C C13444 C14296 C158 C165 C61 C95 N113 N123 N1371 N14407 N15782 N1637 N171 proton neutron H2 5 H32 H4 9 deuteron1320 triton 265 He25 He3 291 He4 2 He517 He624 He83 alpha5810 Li31 Li416 Li534 Li666 Li7137 Li96 Be Be111 Be122 Be41 Be51 Be624 Be7108 Be81195 Be965 O13 12 O O O O O18 11 F159 F1617 F177 F191 Ne161 Ne183 Ne209 Ne211 Ne221 e gamma e anti_nu_e 24 pi0 1 Production for C12 (220 MeV/u), in water (Nuclear reaction : 39 %) Production for C12 (220 MeV/u), in water (Nuclear reaction : 39 %)
86 08/06/ Sensors module Dose / Edep measurement sensor Define a 3D matrix Store information (edep, dose...) and associated uncertainty Allow to dump in files every n events Several accumulation types
87 08/06/ Sensors module Dose / Edep measurement /this/scene/addSensor HitsAccumulatorsSensor mySensor /this/scene/mySensor/hitType post /this/scene/mySensor/attach waterBox /this/scene/mySensor/halfsize cm /this/scene/mySensor/resolution /this/scene/mySensor/position cm /this/scene/mySensor/saveEveryNEvents 200 /this/scene/mySensor/baseFilename output.hdr /this/scene/mySensor/Edep/enable 1 /this/scene/mySensor/Edep/uncertainty 1 /this/scene/mySensor/Edep/squared 1 Type / Name
88 08/06/ Sensors module Dose / Edep measurement /this/scene/addSensor HitsAccumulatorsSensor mySensor /this/scene/mySensor/hitType post /this/scene/mySensor/attach waterBox /this/scene/mySensor/halfsize cm /this/scene/mySensor/resolution /this/scene/mySensor/position cm /this/scene/mySensor/saveEveryNEvents 200 /this/scene/mySensor/baseFilename output.hdr /this/scene/mySensor/Edep/enable 1 /this/scene/mySensor/Edep/uncertainty 1 /this/scene/mySensor/Edep/squared 1 Accumulation type
89 08/06/ Sensors module Dose / Edep measurement /this/scene/addSensor HitsAccumulatorsSensor mySensor /this/scene/mySensor/hitType post /this/scene/mySensor/attach waterBox /this/scene/mySensor/halfsize cm /this/scene/mySensor/resolution /this/scene/mySensor/position cm /this/scene/mySensor/saveEveryNEvents 200 /this/scene/mySensor/baseFilename output.hdr /this/scene/mySensor/Edep/enable 1 /this/scene/mySensor/Edep/uncertainty 1 /this/scene/mySensor/Edep/squared 1 Size, resolution, position
90 08/06/ Carbon depth dose (Bragg peak) Example
91 08/06/ Sensors module Like for the physics and geometry modules, new Sensors and Triggers are very easily created
92 08/06/ Conclusion ThIS is a Geant4-based Therapeutic Irradiation Simulator : Make G4 features available at run-time Designed to be easily extensible Easy to use : no C++, easy scripting Ideal for prototyping, testing, running large numbers of simulations with different parameters... Optimised for image-based simulations
93 08/06/ Conclusion ANR grant funding : “SimCa2 : Simulation for Cancer therapy by Carbon beams” Full time computer science engineer for ThIS Collaborations Geant4 France group (Sébastien Incerti) OpenGate collaboration (Irène Buvat,...) Share common developments
94 08/06/ Future Work Intensive validation ! Optimized navigation in images Cluster / grid version : in progress Repository of beam lines...
95 08/06/ Openness ThIS is an Open Source project Cooperative spirit : CVS repository Wiki documentation Repository of Beam Lines ? Share experiences ? Try It ! If you are interested, contact us
96 08/06/ Thank you for your attention Any question ?