Warning, /geant4/examples/advanced/stim_pixe_tomography/README.md is written in an unsupported language. File is not indexed.
0001 # stim_pixe_tomography advanced example
0002
0003 The stim_pixe_tomography advanced example is developed to simulate three dimensional STIM or
0004 PIXE tomography experiments. The simulation results are written in a binary file and can be easily accessed using the
0005 provided scripts.
0006
0007 Publications:
0008
0009 [1] Li Z, Incerti S, Beasley D, Shen H, Wang S, Seznec H, et al. Accuracy of three-dimensional proton imaging of an
0010 inertial confinement fusion target assessed by Geant4 simulation. Nucl Instrum Methods Phys Res B. 2023;
0011 536:38-44. https://doi.org/10.1016/j.nimb.2022.12.026.
0012
0013 [2] Michelet C, Li Z, Jalenques H, Incerti S, Barberet P, Devs G, et al. A Geant4 simulation of X-ray emission
0014 for three-dimensional proton imaging of microscopic samples. Phys Med. 2022;94:85-93. https://doi.org/10.1016/j.ejmp.2021.12.002.
0015
0016 [3] Michelet C, Li Z, Yang W, Incerti S, Desbarats P, Giovannelli J-F, et al. A Geant4 simulation for
0017 three-dimensional proton imaging of microscopic samples. Phys Med. 2019;65:172-80. https://doi.org/10.1016/j.ejmp.2019.08.022.
0018
0019 Contact:
0020
0021 michelet@lp2ib.in2p3.fr (Claire Michelet)
0022
0023 zhuxin.li@outlook.com (Zhuxin Li)
0024
0025
0026 More information and a detailed UserGuide are available:
0027 http://geant4.in2p3.fr (Documentation section)
0028
0029 ## 1 - GEOMETRY DEFINITION
0030
0031 Three phantoms are available, users can build up new phantoms or choose the following
0032 three phantoms by setting the "phantom_type":
0033
0034 1) A simple cube (see publication [2-3]), phantom_type = 1
0035
0036 The absorber is a box made of a given material.
0037
0038 2) Upper part of Caenorhabditis elegans (C.elegans) worm (see publication [2-3]) , phantom_type = 2
0039
0040 C.elegans phantom is composed of 6 ellipsoids. The size and shape of ellipsoids are based on the
0041 nanotoxicology studies carried-out at LP2I Bordeaux laboratory .
0042
0043 3) Inertial confinement fusion (ICF) target (see publication [1]), phantom_type = 3
0044
0045 ICF target is sphere shell, made of Ge-doped glow discharge polymer (GDP)
0046
0047
0048 ##2 - PHYSICS LIST
0049
0050 Physics lists are based on modular design. Several modules are instantiated:
0051
0052 1) Transportation
0053 2) EM physics
0054 3) Decay physics
0055 4) Hadron physics, optional
0056
0057 EM physics builders can be local or from G4 kernel physics_lists subdirectory.
0058
0059 - "emlivermore" default low-energy EM physics using Livermore data
0060 - "local" local physics builders, options are explicit in PhysListEmStandard
0061 - "emstandard_opt0" recommended standard EM physics for LHC
0062 - "emstandard_opt1" best CPU performance standard physics for LHC
0063 - "emstandard_opt2" similar fast simulation
0064 - "emstandard_opt3" best standard EM options - analog to "local" above
0065 - "emstandard_opt4" best current advanced EM options standard + lowenergy
0066 - "emstandardWVI" standard EM physics and WentzelVI multiple scattering
0067 - "emstandardSS" standard EM physics and single scattering model
0068 - "emstandardGS" standard EM physics and Goudsmit-Saunderson multiple scatt.
0069 - "empenelope" low-energy EM physics implementing Penelope models
0070 - "emlowenergy" low-energy EM physics implementing experimental
0071
0072 Decay and StepMax processes are added to each list.
0073
0074 Optional components can be added:
0075
0076 - "elastic" elastic scattering of hadrons
0077 - "binary" QBBC configuration of hadron inelastic models
0078 - "binary_ion" Binary ion inelastic models
0079
0080 Physics lists and options can be (re)set with UI commands.
0081
0082
0083 ##3 - HOW TO RUN
0084
0085 To run a PIXE tomography simulation in 'batch' mode using a pixe3d.mac file:
0086
0087 ./stim_pixe_tomography -p pixe3d.mac
0088
0089 or if you want to specify the number of threads:
0090
0091 ./stim_pixe_tomography -p pixe3d.mac N
0092
0093 N is the number of threads
0094
0095 An example of pixe3d.mac is provided.
0096 It is designed for the PIXE-T simulation of the cube phantom of 40 um.
0097 It is defined for 10 projections 1 slice 20 pixels. 1000000 protons are used for each beam.
0098
0099
0100 To run a STIM tomography simulation:
0101
0102 ./stim_pixe_tomography -s pixe3d_stim.mac
0103
0104 or if you want to specify the number of threads:
0105
0106 ./stim_pixe_tomography -s pixe3d_stim.mac N
0107
0108 N is the number of threads
0109
0110 An example of pixe3d_stim.mac (arbitrarily name, you may rename it pixe3d.mac if you wish) is provided.
0111 It is designed for the STIM-T simulation of the cube phantom of 40 um.
0112 It is defined for 10 projections 1 slice 20 pixels. 100 protons are used for each beam.
0113
0114 ##4 - VISUALISATION
0115 To visualize the phantoms, run:
0116
0117 ./stim_pixe_tomography
0118
0119 ##5 - OUTPUT FILES
0120
0121 If a PIXE tomography simulation is made, two files are going to be generated:
0122
0123 1) GammaAtCreation.dat, which keeps the info of secondary photons at creation
0124 2) GammaAtExit.dat, which keeps the info of secondary photons at exit of the phantom
0125
0126 If a STIM tomography simulation is made, ProtonAtExit.dat is generated, in which the info of primary protons is kept
0127
0128
0129 ##6 - LIST OF MACROS AND SCRIPTS
0130
0131 Once you build the example, the following macros and script will be copied to your build directory:
0132
0133 pixe3d.mac: an example macro to run a PIXE-T simulation for cube of 40 um
0134 pixe3d_stim.mac: an example macro to run a STIM-T simulation for cube of 40 um
0135 pixe3d_initial.mac: it contains the information of physics processes
0136 init_vis.mac and vis.mac: for the visualization
0137 GPSPointLoop.C: it generates a macro file to run the simulation by reading pixe3d_initial.mac
0138
0139 In the **Scripts** folder, you will find other scripts for different uses.
0140
0141 ***To obtain the reconstruction data:***
0142
0143 BinToStd_ProtonAtExit.C: it reads the STIM-T simulation results and generates the data file for STIM-T reconstruction using selection with particle momentum.
0144 BinToStd_GammaAtCreation.C: it reads the PIXE-T simulation results for X-rays at creation and generates the data file for PIXE-T reconstruction using selection with particle momentum.
0145 BinToStd_GammaAtExit.C: it reads the PIXE-T simulation results for X-rays at exit and generates the data file for PIXE-T reconstruction using selection with particle momentum.
0146 BinToStd_proton_position.C: it reads the STIM-T simulation results and generates the data file for STIM-T reconstruction using selection with particle position and momentum
0147 BinToStd_gamma_position.C: it reads the PIXE-T simulation results for X-rays and generates the data file for PIXE-T reconstruction using selection with particle position and momentum
0148
0149 ***To locate the interruption if an interruption of simulation occurs:***
0150
0151 LocateInterruption_ProtonAtExit.C: in case of interruption, it locates the projection position of interruption for STIM-T simulation.
0152 LocateInterruption_GammaAtExit.C: in case of interruption, it locates the projection position of interruption for PIXE-T simulation.
0153 ***To obtain the reconstruction data in case of an interruption of simulation:***
0154
0155 Concatenate_BinToStd_ProtonAtExit.C: in case of one interruption, it reads STIM-T simulation results and generates the data file for STIM-T reconstruction.
0156 Concatenate_BinToStd_GammaAtCreation.C: in case of one interruption, it reads PIXE-T simulation results for X-rays at creation and generates the data file for PIXE-T reconstruction.
0157 Concatenate_BinToStd_GammaAtExit.C: in case of one interruption, it reads PIXE-T simulation results for X-rays at exit and generates the data file for PIXE-T reconstruction.
0158 ***To visualize the spectrum:***
0159
0160 Spectrum_proton.C: it visualizes the spectrum of protons and plots a histogram by reading simulation result ProtonAtExit.dat.
0161 Spectrum_gamma.C: it visualizes the spectrum of X-rays and plots a histogram by reading simulation result GammaAtCreation.dat or GammaAtExit.dat.
0162 TomoSpectrum_HIST_proton.C: it visualizes the spectrum of protons and plots a histogram by reading StimEvent data. It also writes the spectrum data in a txt file.
0163 TomoSpectrum.C: it visualizes the spectrum of X-rays and plots a graph by reading PixeEvent data. It also writes the spectrum data in a txt file.
0164 TomoSpectrum_HIST.C: it visualizes the spectrum of X-rays and plots a histogram by reading PixeEvent data. It also writes the spectrum data in a txt file.
0165 ***Scripts for specific use:***
0166
0167 Extract_Projection.C: it extracts 50 projections from a PixeEvent data file for tomographic reconstruction, which contains 100 projections. In fact, it extracts the projection 0, 2, 4, 6, 898 from projections 0-99. It eventually generates a new file with new index number of projections 0-49.
0168 Check_PixeEventFile.C: it checks if the index of projections of a PixeEvent data file for tomographic reconstruction is correct. For example, if the user extract 50 projections from a data file composed 100 projections, it is necessary to make sure in the new data file, the index of projection starts from 0 and ends at 49.
0169 Extract_Slice.C: it extracts a certain number of slice(s) from a PixeEvent data file for tomographic reconstruction. Users need to specify the first and the last slice to be extracted. Note that when writing a new data file, the index of slices will be initiated from 0.
0170 Concatenate_BinToStd_GammaAtCreation_fabricate.C: if users make a PIXE-T simulation on a symmetrical object with only one projection, this script can be used to fabricate the other 99 projection data for X-rays at creation with same energy.
0171 Concatenate_BinToStd_GammaAtExit_fabricate.C: if users make a PIXE-T simulation on a symmetrical object with only one projection, this script can be used to fabricate the other 99 projection data for X-rays at exit with same energy
0172 ***Scripts to generate voxelized phantoms:***
0173
0174 In order to compare the reconstructed tomographic images with original
0175 phantoms, it may be necessary to use a voxelized phantom.
0176
0177 generate_voxelized_sphere_phantom.py: it generates a voxelized phantom of an inertial confinement fusion target.
0178 generate_voxelized_worm_phantom.py: it generates a voxelized phantom of the upper part of C. elegans.
0179 More information can be found in the UserGuide.