This is easy ! Running a simulation



Yüklə 445 b.
tarix27.10.2017
ölçüsü445 b.











ThIS is easy !

  • Running a simulation :



ThIS is easy !

  • Running a simulation :



ThIS is easy !

  • Running a simulation :









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)



Main modules

  • Main modules

    • Physics
    • Geometry (scene)
    • Sensors & Triggers
    • Beam
  • Run-time vs Compile-time















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)


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)


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)


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)


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)


Physics module

  • ThISPhysicsList :

    • Output user selected physics


Physics module

  • ThISPhysicsList :

    • Output user selected physics


Physics module



Physics module



Physics module



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)


Cuts

  • Setting cuts in ThIS

    • Production cuts
    • MaxStepLimiter “cuts”
    • Killing cuts


Cuts

  • Setting cuts in ThIS

    • Production cuts
    • MaxStepLimiter “cuts”
    • Killing cuts


Cuts

  • Setting cuts in ThIS

    • Production cuts
    • MaxStepLimiter “cuts”
    • Killing cuts


Cuts

  • Setting cuts in ThIS

    • Production cuts
    • MaxStepLimiter “cuts”
    • Killing cuts


Cuts

  • Setting cuts in ThIS

    • Production cuts
    • MaxStepLimiter “cuts”
    • Killing cuts


Cuts

  • Setting cuts in ThIS

    • Production cuts
    • MaxStepLimiter “cuts”
    • Killing cuts


Main modules

  • Main modules

    • Physics
    • Geometry (scene)
    • Sensors & Triggers
    • Beam
  • Run-time vs Compile-time



Main modules

  • Main modules

    • Physics
    • Geometry (scene)
    • Sensors & Triggers
    • Beam
  • Run-time vs Compile-time



Scene module

  • ThISDetectorConstructor :

    • Dynamic (run-time) scene description
    • Add volumes
    • Set properties (position, material ...)


Scene module

  • ThISDetectorConstructor :

    • Some G4 simple shapes (Box, Cone ...)


Scene module

  • ThISDetectorConstructor :





Scene module

  • ThISDetectorConstructor :

    • Some G4 simple shapes (Box, Cone ...)
    • Complex user defined shapes (in progress)


Scene module

  • ThISDetectorConstructor :

    • Some G4 simple shapes (Box, Cone ...)
    • Complex user defined shapes (in progress)


Scene module

  • ThISDetectorConstructor :

    • Some G4 simple shapes (Box, Cone ...)
    • Complex user defined shapes (in progress)


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


Scene module



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();
  • };



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;
  • }

  • //============================================================



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);
  • }



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)


Scene module

  • ThISDetectorConstructor :

    • Easy to add elements/materials


Scene module



Scene module

  • Insert images in simulation

    • Transform CT image into composition image
        • Calibrate Scanner using phantom [schneider et al. 2000]
        • Transform CT image :
          • => image of labels + label to material table
        • => Provided in ThISiS
    • Insert label image in G4 simulation


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


Scene module

  • Insert images in simulation

    • 1) Reduce image complexity
    • 2) Change G4 navigation algorithm


Scene module

  • Insert images in simulation

    • 1) Reduce image complexity


Scene module

  • Insert images in simulation

    • 1) Reduce image complexity
      • Merge adjacent voxels having similar materials :
          • Image Segmentation problem


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]


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.]


Scene module

  • Insert images in simulation

    • 1) Reduce image complexity
      • Merge adjacent voxels having similar materials :
          • Image Segmentation problem
      • Segmentation methods available in ThISiS


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


Scene module

  • Insert images in simulation

    • Image volumes
    • Label image (Analyze, raw formats ...)
    • Label to material information


Scene module

  • Insert images in simulation

    • Image volumes
    • Label image (Analyze, raw formats ...)
    • Label to material information


Scene module

  • Insert images in simulation

    • Image volumes
    • Label image (Analyze, raw formats ...)
    • Label to material information


Scene module

  • Insert images in simulation

    • Image volumes
    • Label image (Analyze, raw formats ...)
    • Label to material information


Scene module

  • Results



Scene module

  • Results



Scene module

  • Results



Scene module

  • Insert images in simulation

    • 1) Reduce image complexity
    • 2) Change G4 navigation algorithm


Scene module

  • Insert images in simulation

    • 1) Reduce image complexity
    • 2) Change G4 navigation algorithm
      • [Jiang & Paganetti 2004] : in progress


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


Scene module

  • ThISDetectorConstructor :

    • Done :
      • main mechanism
      • simple base shapes / complex volumes
    • To do :
  • Image volumes

    • Associated image preparation tools (ThISiS)
      • Calibration
      • Segmentation
    • Optimized volumes
      • ImageIsothetic (octree segmented images)
      • ImageRegionalised (segmented images)
    • Optimized navigator : in progress


Main modules

  • Main modules

    • Physics
    • Geometry (scene)
    • Sensors & Triggers
    • Beam
  • Run-time vs Compile-time



Main modules

  • Main modules

    • Physics
    • Geometry (scene)
    • Sensors & Triggers
    • Beam
  • Run-time vs Compile-time



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 ...


Sensors module



Sensors module

  • Triggers

    • All sensors can be associated with a trigger :
      • Including, excluding particle from a measurement
      • Sorting on energy ...


Sensors module

  • Triggers

    • All sensors can be associated with a trigger :
      • Including, excluding particle from a measurement
      • Sorting on energy ...


Sensors module

  • ThISSensor

    • Two examples of sensors :
    • Particles counter
    • Dose sensor (energy deposited + uncertainty)


Sensors module

  • ThISParticleCounter



Sensors module



Sensors module



Sensors module



Example



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


Sensors module

  • Dose / Edep measurement



Sensors module

  • Dose / Edep measurement



Sensors module

  • Dose / Edep measurement



Example



Sensors module

  • Like for the physics and geometry modules, new Sensors and Triggers are very easily created



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


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


Future Work

  • Intensive validation !

  • Optimized navigation in images

  • Cluster / grid version : in progress

  • Repository of beam lines

  • ...



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





Yüklə 445 b.

Dostları ilə paylaş:




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©muhaz.org 2020
rəhbərliyinə müraciət

    Ana səhifə