Pedro Arce G4WS’10 October 6th, 2009 1 Voxelised geometries intersected with a volume Pedro Arce CIEMAT, Madrid 2010 Geant4 Workshop ESA, 4-8 October 2010.

Slides:



Advertisements
Similar presentations
Building Portals to access Grid Middleware National Technical University of Athens Konstantinos Dolkas, On behalf of Andreas Menychtas.
Advertisements

Geant4 v9.2p02 Speed up Makoto Asai (SLAC) Geant4 Tutorial Course.
Spreadsheet Basics Computer Technology.
Spreadsheet Basics Computer Technology.
Chapter 4 : File Systems What is a file system?
GAMOS tutorial Histogram and Scorers Exercises
Pedro Arce Point detector scoring 1 Point detector scoring in GEANT4 Pedro Arce, (CIEMAT) Miguel Embid (CIEMAT) Juan Ignacio Lagares (CIEMAT) Geant4 Event.
Create slices and hotspots Create links in Web pages Create rollovers from slices Create basic animation Add tweening symbol instances to create animation.
SLAC Geant4 Tutorial 2009 J. Perl
14 Overview of Geant4 Examples 2 nd Finnish Geant4 Workshop 6-7 June 2005 Dennis Wright (SLAC)
Spatial Indexing I Point Access Methods. Spatial Indexing Point Access Methods (PAMs) vs Spatial Access Methods (SAMs) PAM: index only point data Hierarchical.
Some tips for geometries of medical applications Makoto Asai (SLAC)
Spatial Indexing I Point Access Methods. Spatial Indexing Point Access Methods (PAMs) vs Spatial Access Methods (SAMs) PAM: index only point data Hierarchical.
Witek Pokorski, Radovan Chytracek, Jeremy McCormick, Giovanni Santin
Geometry 5 I.Hrivnacova¹, J.Apostolakis² ¹IPN, Orsay; ²CERN Cours Paris June 2007.
Managing Business Data Lecture 8. Summary of Previous Lecture File Systems  Purpose and Limitations Database systems  Definition, advantages over file.
Geant4 Collaboration workshop Layered Mass Geometry Improvements for Brachytherapy Applications Shirin A. Enger, Michel D'Amours Université Laval Centre.
In the G4/ROOT hierarchy there are three conceptual layers: - G4VSolid: shape, size - G4VSolid: shape, size - G4LogicalVolume: material, MF, sensitivity,
ALICE Offline week, CERN 21 February 2005 I. Hrivnacova 1 New geometry framework in MUON I.Hrivnacova IPN, Orsay ALICE Offline week, CERN 21 February 2005.
REVIEW 2 Exam History of Computers 1. CPU stands for _______________________. a. Counter productive units b. Central processing unit c. Copper.
The Voxel geometry FLUKA Courses Houston may 2007.
© 2012 Adobe Systems Incorporated. All Rights Reserved. Copyright 2012 Adobe Systems Incorporated. All rights reserved. ® INTRODUCTION TO FLASH ANIMATION.
P HI T S PHITS Tutorial for making Voxel Phantom Multi-Purpose Particle and Heavy Ion Transport code System title1 Last revised 2014/8.
S. Guatelli, CPS Innovations, Knoxville, 13 th -21 st January Brachytherapy exercise.
Pedro Arce Introducción a GEANT4 1 GAMOS tutorial Plug-in’s Exercises Pedro Arce Dubois CIEMAT
GAMOS tutorial X-ray Exercises
GPU Broad Phase Collision Detection GPU Graphics Gary J. Katz University of Pennsylvania CIS 665 Adapted from articles taken from GPU Gems III.
S. Guatelli, M.G Pia, INFN Genova G. Cosmo, S. Guatelli, M.G Pia Salamanca, July 2002
Copyright © 2010 Altair Engineering, Inc. All rights reserved.Altair Proprietary and Confidential Information Section 4 Applications.
Daniel Pérez-Astudillo World Congress 2009, Munich, 12 September 2009
Darmstadt, 15. November 2015 Tobias Stockmanns, FZ Jülich1 A STEP to ROOT converter for the FairRoot framework ALICE-FAIR Computing Meeting, GSI,
Practical PC, 7 th Edition Chapter 4: File Basics.
WIRED 4 An extensible generic Event Display Mark Donszelmann SLAC, Stanford, U.S.A. CHEP2004, 27 september – 1 october Interlaken, Switzerland.
Geometry 4 I.Hrivnacova IPN, Orsay Most slides thanks to M. Asai, SLAC Cours Paris June 2007.
New software library of geometrical primitives for modelling of solids used in Monte Carlo detector simulations Marek Gayer, John Apostolakis, Gabriele.
Jump to first page The new ROOT geometry package Andrei Gheata - ALICE Institute of Space Sciences, Bucharest.
Pedro Arce GAMOS MCTP2009 October 21st, 2009 GAMOS: an easy and flexible framework for GEANT4 simulations Pedro Arce Juan Ignacio Lagares Daniel Pérez.
C++ / G4MICE Course Session 5 Materials in G4MICE Units in G4MICE Visualisation in G4MICE G4MICE Modelling.
Adding Text to Slides PowerPoint 97- Intermediate.
STATUS OF THE UNIFIED SOLIDS LIBRARY Gabriele Cosmo/CERN Tatiana Nikitina/CERN.
Outline  Developments/fixes in the last year  Introduced in release 9.6 and patches  Planned for release 10.0 and ongoing …  Currently under development.
P HI T S PHITS Tutorial How to use DICOM2PHITS Multi-Purpose Particle and Heavy Ion Transport code System Title1 Last revised 2015/3.
Pedro Arce Introducción a GEANT4 1 GAMOS tutorial RadioTherapy Exercises Pedro Arce Dubois CIEMAT
Update G4builder issues Talk written almost entirely by Stan Bentvelsen with a few updates from Christopher Lester ATLAS G4 Workshop December 2000 CAMBRIDGE.
Spreadsheet Basics Computer Technology What is a spreadsheet? Spreadsheets are: –Applications that track, analyze, and chart numeric information –Used.
17-19 Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan 2007 Geant4 Collaboration.
Hands-On Microsoft Windows Server 2008 Chapter 7 Configuring and Managing Data Storage.
Geometry 3 I.Hrivnacova IPN, Orsay Most slides thanks to M. Asai, SLAC Cours Paris June 2007.
1 Berger Jean-Baptiste
Flair development for the MC TPS Wioletta Kozłowska CERN / Medical University of Vienna.
UNIT 11: 3D AutoCAD Objectives: How to print or plot a drawing How to setup a layout using title blocks and viewports Create and manage new layouts Be.
Makoto Asai.  In the past, material is considered only if it appears in the mass (tracking) world. The user might define parallel world(s) for artificial.
Electronic Visualization Laboratory University of Illinois at Chicago “Fast And Reliable Space Leaping For Interactive Volume Rendering” by Ming Wan, Aamir.
Multi-Purpose Particle and Heavy Ion Transport code System
Geant4 Geometry Speed-ups
3D Modeling Basics Three basic types of 3D CAD models:
Spatial Indexing I Point Access Methods.
GAMOS tutorial Shielding Exercises
Geant based inverse planning for radiotherapy Low-hanging fruit
Introduction Goal: Can we reconstruct the energy depositions of the proton in the brain if we are able to reconstruct the photons produced during this.
Geometry checking tools
Spreadsheet Basics Computer Technology.
GENERAL VIEW OF KRATOS MULTIPHYSICS
Spreadsheet Basics Computer Technology.
INTRODUCTION TO FLASH ANIMATION
Spreadsheet Basics Computer Technology.
GAMOS tutorial Plug-in’s Exercises
Modeling and Visualization Hajime Yoshida Naruto UE
Spreadsheet Basics Computer Technology.
Unit J: Creating a Database
Presentation transcript:

Pedro Arce G4WS’10 October 6th, Voxelised geometries intersected with a volume Pedro Arce CIEMAT, Madrid 2010 Geant4 Workshop ESA, 4-8 October 2010

Pedro Arce G4WS’10 October 6th, Use case  A DICOM voxelised geometry of a human or animal taken by a CT or MRI is used in a PET/SPECT or radiotherapy treatment  DICOM geometry is a box, that encompass the human/animal plus the surrounding air  This box does not fit into the accelerator head or detector bore of the detector: the air overlaps with it

Pedro Arce G4WS’10 October 6th, Regular navigation today  G4RegularNavigation/G4PhantomParameterisation with skipping voxel boundaries is the fastest navigation option  4/6 times faster that any other for a realistic phantom (see poster at NSS/MIC 2008)  But it can only be used for box geometries: voxels are inside a container volume filing it completely  When a track enters the container it always enters one voxel, which can be easily identified, as the geometry is very regular  If container would not be filled, when a track is in the space between the container walls and the voxels G4Navigator::LevelLocate has to calculate the positions of many voxels to know in which one the track is going to enter (usually there are millions of voxels) No need to look into them all if 3D optimisation is used

Pedro Arce G4WS’10 October 6th, Solution 1.Extend G4PhantomParemeterisation for cases where voxels do not form a box and do not fill completely the mother volume  Option 1: do not allow discontinuous geometries (no empty voxel between two filled voxels)  Option 2: allow discontinuous geometries Option 1 faster and less memory than option 2 2.Implement a tool that calculates automatically the intersection between a DICOM geometry and any volume (existing in the Geant4 geometry or created ´ad hoc´ by the user)

Pedro Arce G4WS’10 October 6th, Old DICOM format  Old DICOM Geant4 text file format (binary file format is also supported)  See examples/extended/medical/DICOM 2 // number of materials 0 G4_AIR // material list 1 G4_WATER // number of voxels in X/Y/Z // Extension in X, Y, Z // index of material for each voxel … // densities for each voxel …

Pedro Arce G4WS’10 October 6th, New DICOM format Same format but add list of which voxels are filled: (Standard practice is to define a phantom in Z-slices)  Loop to Z slices,  Loop to Y rows  Option 1:  Minimum and maximum X of the filled voxels  Option 2:  Number of discontinuous X voxel sets  Minimum and maximum X of each voxel set List of material indices for each voxel List of densities for each voxel

Pedro Arce G4WS’10 October 6th, New DICOM format -30 < Z < -10 Y=-20 Y=20 X=-30 X= < Z < -10 Y=-20 Y=20 X=-30 X=30 10 < Z < 30 Y=-20 Y=20 X=-30 X=30 2 // number of materials 0 G4_AIR // material list 1 G4_WATER // number of voxels in X/Y/Z // Extension in X, Y, Z // list of which voxels are filled // material indices // densities

Pedro Arce G4WS’10 October 6th, New DICOM reader  Create a new DICOM reader  Instantiates a G4PartialPhantomParameterisation with fRegularStructureID = 2 (G4PhantomParameterisation has fRegularStructureID = 1) No change in G4Navigator or G4RegularNavigation needed  Only if( getRegularStructureID() != 1 )  if( getRegularStructureID() == 0 )

Pedro Arce G4WS’10 October 6th, G4PartialPhantomParameterisation Two problems to solve 1.Given a copyNo, which is the corresponding voxel position 2.Given a position in phantom local coordinates, in which voxel it is in 1.Voxel position from copyNo  Build a std::multiset with an entry per each ZY row (i.e. looping in Z and then in Y)  Store accumulated number of voxels filled < Z < -10 Y=-20 Y=20 X=-30 X= < Z < -10 Y=-20 Y=20 X=-30 X= < Z < -10 Y=-20 Y=20 X=-30 X=

Pedro Arce G4WS’10 October 6th, G4PartialPhantomParameterisation Option 1:  Build a G4int* minXVoxels = new G4int[totalNcopies]; Minimum ID of X voxels for each ZY row Option 2:  Build a std::multiset * minXVoxels = new std::multiset Set of minimum IDs of X voxels in each discontinuous set for each ZY row G4int nvoxXprev; if( dist != 0 ) { ite--; nvoxXprev = (*ite).first; } else { nvoxXprev = -1; } nx = ifmin+copyNo-nvoxXprev-1; std::multimap ::const_iterator ite = fFilledIDs.lower_bound(size_t(copyNo)); G4int dist = std::distance( fFilledIDs.begin(), ite ); nz = size_t(dist/fNoVoxelY); ny = size_t( dist%fNoVoxelY ); G4int ifmin = (*ite).second; void G4PartialPhantomParameterisation::ComputeVoxelIndices(

Pedro Arce G4WS’10 October 6th, G4PartialPhantomParameterisation 2. copyNo from track position G4int nx = G4int( (localPoint.x()+fContainerWallX+kCarTolerance)/(fVoxelHalfX*2.) ); G4int ny = G4int( (localPoint.y()+fContainerWallY+kCarTolerance)/(fVoxelHalfY*2.) ); G4int nz = G4int( (localPoint.z()+fContainerWallZ+kCarTolerance)/(fVoxelHalfZ*2.) ); G4int nyz = nz*fNoVoxelY+ny; std::multimap ::iterator ite = fFilledIDs.begin(); advance(ite,nyz); std::multimap ::iterator iteant = ite; iteant--; G4int copyNo = (*iteant).first ( nx - (*ite).second );

Pedro Arce G4WS’10 October 6th, Automatic phantom-volume intersection User writes a user command: 1.Intersection is calculated 2. Partial DICOM file is written 3.Job ends /readDICOM/intersectWithG4Volume VOLUME_NAME  Extract G4VSolid from existing volume /readDICOM/intersectWithUserVolume POS_X POS_Y POS_Z ROTANG_X ROTANG_Y ROTANG_Z SOLID_TYPE SOLID_PARAM1 (SOLID_PARAM2, ….)  Build a G4VSolid using the utilities of ASCII geometry format  All Geant4 solid shapes available (booleans, tellesated, twisted, …)

Pedro Arce G4WS’10 October 6th, Tests Take a 200x200x10 voxel geometry and intersect it with a volume  Read the new DICOM file  Send tracks everywhere  Plot for each Z layer X vs Y position when an interaction occurred in the “phantom” volume # only steps in phantom /gamos/filter InPhantomF GmInLogicalVolumeFilter phantom # classify by the Z position (a different histogram for each Z interval) /gamos/classifier ZposC GmClassifierByNumericData FinalPosZ /10 # select what to plot /gamos/setParam GmStepDataHistosUA_InPhantomF_ZposC:DataList FinalPosX.vs.FinalPosY # build histograms each step using filter and classifier gamos/userAction GmStepDataHistosUA InPhantomF ZposC

Pedro Arce G4WS’10 October 6th, Tests Intersect with a rotated cylinder /gamos/readDICOM/intersectWithUserVolume *deg TUBE < Z < < Z < < Z < < Z < < Z < 0 -0 < Z < 20

Pedro Arce G4WS’10 October 6th, Tests Intersect with a polyhedra /gamos/readDICOM/intersectWithUserVolume *deg POLYHEDRA *deg

Pedro Arce G4WS’10 October 6th, Status G4PartialPhantomParameterisation option 1 (does not support non- contiguous voxels) Automatic intersection utility for any solid shape in Geant4 (option 1)  Test for CPU and memory performance  Test performance of containers (std::multimap )  10 M entries std::multimap  45 sec to fill  307 Mg memory  But very fast search  G4PartialPhantomParameterisation option 2 (support non-contiguous voxels)  As a separate class G4PartialNonContiguousPhantomParameterisation ?