KAHIBARO Bookshelves
Discord Login Register

21.5. Detector Maps

Crystal occupancy

In PET or SPECT simulations, a detector is usually made of many repeated elements such as crystals or pixels. Each detected event is assigned to one of these elements, for example a specific crystal in a PET ring or a pixel in a gamma camera. A detector map summarizes how many events are recorded in each element. When you visualize this as an image, you obtain an occupancy map of the detector.

In GATE with ROOT output, crystal identity is encoded in integer identifiers. Common branch names in singles or hits trees include fields like crystalID, moduleID, ringID, or a more general detID. The exact naming depends on how the detector hierarchy was defined in your simulation, but the principle is always the same. Every event corresponds to one detector element, and you can count how many events fell into each element.

To build a crystal occupancy map you typically follow these steps using ROOT:

First, open the ROOT file written by GATE and get the tree corresponding to the data of interest. For imaging detectors, the Singles or Hits tree is often used because it contains detector-level information and high statistics. Second, inspect the branches to find which integer field encodes crystal identity and which encodes additional levels such as module or ring indices. ROOT tools like TTree::Print() or the ROOT browser help you to discover the branch structure.

Third, for each event in the tree, fill a histogram that bins in the detector ID. For a simple linear indexing, you can create a one dimensional histogram where the x axis index corresponds to crystalID. For more structured geometries, you may instead define a two dimensional histogram, for instance with ringID along one axis and crystalID within the ring on the other axis. This allows you to view occupancy in a form that resembles the physical layout of the scanner.

In practice, a typical ROOT macro would create something like TH1I hOccupancy("hOccupancy", "Crystal occupancy;Crystal ID;Counts", nCrystals, -0.5, nCrystals - 0.5) and fill it with hOccupancy.Fill(crystalID) inside an event loop. Alternatively, ROOT’s Draw command can be used interactively, for example Singles->Draw("crystalID>>hOccupancy"). For two dimensional maps, a command like Singles->Draw("crystalID:ringID>>h2( nCrystalBins, -0.5, ..., nRingBins, -0.5, ... )") will fill a TH2 histogram automatically.

Once filled, the occupancy histogram reveals how uniformly your detector is used. Ideally, in a symmetric configuration with a centered source, the occupancy pattern should be symmetric. For a PET ring with a central point source, all crystals at the same radius should show similar counts, resulting in a periodic pattern with the same peak height across the ring. Any crystal with significantly fewer or zero counts may indicate a problem in the geometry, detector IDs, or digitizer configuration.

Occupancy maps are particularly useful to catch configuration mistakes. If entire modules or rings have zero occupancy, it may mean that their placement is wrong, that they are outside the field of view, or that the digitizer chain does not assign IDs correctly for those elements. If occupancy is highly uneven in a geometry that should be uniform, this can signal misaligned sources, incorrect material assignments causing unexpected attenuation, or errors in the rotation or translation of detector components.

You can also compare crystal occupancy between simulations. For example, by simulating the same setup with different physics options or source sizes, you can create normalized occupancy maps and see how scatter or attenuation redistributes counts among crystals. This is especially important when evaluating the performance of different collimators or shielding designs, where occupancy at the edges or behind shielding parts may change.

Occupancy maps are not limited to PET crystals. For SPECT gamma cameras, you can treat detector pixels as elements in a two dimensional array. In ROOT, you produce a 2D histogram with pixel indices on each axis and fill it with hits or singles coming from the scintillation crystal. The resulting image is a raw flood field, similar to what one measures in detector quality tests. After normalization, such maps can be used to derive correction factors for non uniform detector response.

To visualize occupancy histograms in ROOT you typically use Draw("COLZ") for two dimensional maps, which color codes the intensity of counts. For one dimensional histograms you inspect shapes, peaks, and gaps. You should also pay attention to statistical fluctuations; crystals with few counts will show larger relative fluctuations, so it is helpful to run enough events so that the occupancy pattern is dominated by systematic effects rather than random noise.

Occupancy maps are also a first step toward building more advanced detector response models. Once you understand which crystals receive which fraction of events in a reference configuration, you can study how mechanical misalignments, dead channels, or energy thresholds affect the occupancy distribution. Comparing an ideal map from simulation with measured detector flood fields helps validate your geometry and detector modeling.

Finally, it is helpful to summarize the key idea: a crystal occupancy map is simply the count of events per detector element, organized according to the detector’s indexing scheme. When interpreted correctly, it is a powerful diagnostic tool to verify detector geometry, check for dead or missing elements, and understand how the detector responds to different source positions and configurations.

A detector occupancy map is built by counting events per detector element (for example per crystal or pixel) using integer detector IDs from the ROOT tree. Large differences or zeros in occupancy for elements that should be equivalent usually indicate geometry or configuration errors.

Detector counts

Detector counts are the basic quantitative measure produced by imaging simulations and experiments. Every time a particle interaction in the detector satisfies your detection and digitization criteria, it contributes one count. By analyzing how these counts accumulate across time, energy, and detector elements you can understand the performance of your system.

In GATE with ROOT output, counts are not stored explicitly; instead, each row in a ROOT tree represents a detection or interaction event. For example, in a Singles tree every entry is a detected single photon, and in a Coincidences tree every entry is a paired event. To obtain total counts you simply count the number of entries that pass a given selection. ROOT provides this through the number of entries in the tree or by applying selection criteria in Draw or TTree::GetEntries("cut expression").

A simple global count is the total number of singles or coincidences recorded during a simulation. If your simulation is time based, this can be converted to a count rate, usually expressed in counts per second. For example, if the Singles tree has $N$ entries and the acquisition time simulated is $T$, the mean singles rate is $R = N / T$. Similarly, the coincidence rate is obtained from the size of the Coincidences tree.

More detailed information comes from counting events by energy. With ROOT, you create a histogram of the measured or simulated energy using a command such as Singles->Draw("energy>>hE( nbins, Emin, Emax )"). The area under the histogram represents the total counts, and the shape of the spectrum shows features such as photopeaks and Compton continua. By integrating counts inside a chosen energy window you quantify how many events fall into the useful range for your imaging task versus those that are likely scatter or noise.

Detector counts can also be studied as a function of time when time stamps are available. In ROOT, you may have a time branch that records the detection time relative to the start of acquisition. By filling a histogram of time, you obtain a time activity curve of detected counts. This is useful in dynamic imaging studies or when simulating radioactive decay across longer time intervals. It also helps verify that your simulation of time dependent activity or motion is behaving as expected.

Spatial distributions of counts can be examined in combination with detector IDs, as described in the occupancy section. Here, the focus is not on which element was hit but on how many counts each element received. By summing counts over different angles, modules, or rings, you can build projection data, sinograms, or flood fields depending on the imaging modality. For PET, counts can be binned into lines of response according to the positions of the two detectors in each coincidence, producing sinograms that are the input to reconstruction algorithms. For SPECT, 2D count maps as a function of detector pixel and angle form projection images.

In ROOT, constructing these more complex count distributions often involves using two or more variables together, for example Coincidences->Draw("detectorID2:detectorID1>>hLOR( ... )") to build a simple LOR map, or including angular coordinates to sort counts by projection angle. The bins of such histograms then give you the number of counts per geometrical or physical bin.

Detector counts are directly related to key performance metrics. Sensitivity is defined as the number of detected events per unit activity and per unit time. In simulation you can calculate sensitivity by dividing the number of counts in your accepted energy and timing windows by the product of the source activity and simulation duration. Noise properties depend on the statistics of counts in each bin. For large numbers of counts, statistical fluctuations are described by Poisson statistics, where the standard deviation in a bin with $N$ counts is approximately $\sqrt{N}$.

This connection means that achieving low statistical uncertainty requires enough counts in each bin of interest. In practice, you can estimate the relative statistical uncertainty as $\sqrt{N}/N = 1/\sqrt{N}$. If, for instance, you want a relative uncertainty of 1% in a particular detector element or energy bin, you need at least $N \approx 10^4$ counts in that bin. When the counts are too low, detector maps and spectra become noisy and it is hard to distinguish real patterns from random variations.

Detector counts also provide a way to verify that your simulation configuration is consistent when you change parameters. For example, if you double the simulated activity while keeping geometry and acquisition time fixed, you should expect approximately double the counts in each bin, within statistical uncertainty. If instead counts do not scale as expected, this might reveal hidden bottlenecks such as saturated detectors, too strict energy thresholds, or incorrect time windows.

In ROOT based analysis, cuts and filters let you refine detector counts to specific subsets of interest. For example, you can count only primary photons by applying a filter on a primaryID or process branch, or count only events in a central region of the detector by imposing conditions on detector coordinates. This is essential when separating true, scattered, and random events in PET, or when assessing counts in specific regions of SPECT or CT detectors.

Finally, when you document or report your simulation results, always relate detector counts to simulation conditions. Counts without context can be misleading because they depend strongly on source strength, acquisition time, geometry, and energy windows. By stating the number of counts together with activity, time, detector configuration, and selection criteria, you make your results reproducible and comparable across simulations.

Detector counts in ROOT based GATE analysis are obtained by counting tree entries that pass a given selection. The statistical uncertainty in a bin with $N$ counts is approximately $\sqrt{N}$, so the relative uncertainty is $1 / \sqrt{N}$. High precision therefore requires large enough counts per bin.

Views: 0

Comments

Please login to add a comment.

Don't have an account? Register now!

Where to Move

Move chapter:

  • ☰ 1. Introduction to GATE
    • ☰ 1.1. What Is GATE?
      • ☰ 1.2. Applications of GATE
        • ☰ 1.3. GATE vs Geant4
          • ☰ 1.4. GATE Simulation Workflow
          • ☰ 2. Installing GATE
            • ☰ 2.1. GATE Requirements
              • ☰ 2.2. Creating a Python Environment
                • ☰ 2.3. Installing GATE
                  • ☰ 2.4. Verifying the Installation
                    • ☰ 2.5. GATE Example Simulations
                    • ☰ 3. Python Basics for GATE
                      • ☰ 3.1. Variables and Data Types
                        • ☰ 3.2. Conditional Statements
                          • ☰ 3.3. Loops
                            • ☰ 3.4. Functions
                              • ☰ 3.5. Python Modules
                                • ☰ 3.6. NumPy Basics
                                  • ☰ 3.7. Working with Files
                                  • ☰ 4. Creating Your First GATE Simulation
                                    • ☰ 4.1. Importing GATE
                                      • ☰ 4.2. Creating a Simulation
                                        • ☰ 4.3. Adding the World
                                          • ☰ 4.4. Adding a Particle Source
                                            • ☰ 4.5. Adding an Actor
                                              • ☰ 4.6. Running the Simulation
                                                • ☰ 4.7. Inspecting the Results
                                                • ☰ 5. Units in GATE
                                                  • ☰ 5.1. Physical Units
                                                    • ☰ 5.2. Length Units
                                                      • ☰ 5.3. Energy Units
                                                        • ☰ 5.4. Time Units
                                                          • ☰ 5.5. Radioactivity Units
                                                            • ☰ 5.6. Using Units Correctly
                                                            • ☰ 6. Geometry Fundamentals
                                                              • ☰ 6.1. The World Volume
                                                                • ☰ 6.2. Creating Volumes
                                                                  • ☰ 6.3. Box Geometry
                                                                    • ☰ 6.4. Cylindrical Geometry
                                                                      • ☰ 6.5. Spherical Geometry
                                                                        • ☰ 6.6. Position and Translation
                                                                          • ☰ 6.7. Rotation
                                                                          • ☰ 7. Building Complex Geometry
                                                                            • ☰ 7.1. Nested Volumes
                                                                              • ☰ 7.2. Repeated Volumes
                                                                                • ☰ 7.3. Ring Geometry
                                                                                  • ☰ 7.4. Boolean Geometry
                                                                                    • ☰ 7.5. Geometry Overlap
                                                                                      • ☰ 7.6. Reusable Geometry Functions
                                                                                      • ☰ 8. Materials
                                                                                        • ☰ 8.1. Material Definitions
                                                                                          • ☰ 8.2. Geant4 Material Database
                                                                                            • ☰ 8.3. Common Medical Materials
                                                                                              • ☰ 8.4. Detector Materials
                                                                                                • ☰ 8.5. Shielding Materials
                                                                                                  • ☰ 8.6. Creating Custom Materials
                                                                                                  • ☰ 9. Geometry Visualization
                                                                                                    • ☰ 9.1. Enabling Visualization
                                                                                                      • ☰ 9.2. Displaying Volumes
                                                                                                        • ☰ 9.3. Changing the View
                                                                                                          • ☰ 9.4. Volume Appearance
                                                                                                            • ☰ 9.5. Visualizing Particle Tracks
                                                                                                              • ☰ 9.6. Debugging with Visualization
                                                                                                              • ☰ 10. Particle Sources
                                                                                                                • ☰ 10.1. Generic Sources
                                                                                                                  • ☰ 10.2. Particle Types
                                                                                                                    • ☰ 10.3. Source Position
                                                                                                                      • ☰ 10.4. Source Direction
                                                                                                                        • ☰ 10.5. Source Energy
                                                                                                                          • ☰ 10.6. Source Activity
                                                                                                                          • ☰ 11. Radioactive Sources
                                                                                                                            • ☰ 11.1. Radioactive Decay
                                                                                                                              • ☰ 11.2. Medical Radionuclides
                                                                                                                                • ☰ 11.3. Positron Emitters
                                                                                                                                  • ☰ 11.4. Gamma Emitters
                                                                                                                                    • ☰ 11.5. Activity Distribution
                                                                                                                                      • ☰ 11.6. Time-Dependent Activity
                                                                                                                                      • ☰ 12. Physics Lists
                                                                                                                                        • ☰ 12.1. What Is a Physics List?
                                                                                                                                          • ☰ 12.2. Electromagnetic Physics
                                                                                                                                            • ☰ 12.3. Gamma Physics
                                                                                                                                              • ☰ 12.4. Electron Physics
                                                                                                                                                • ☰ 12.5. Positron Physics
                                                                                                                                                  • ☰ 12.6. Hadronic Physics
                                                                                                                                                    • ☰ 12.7. Choosing Physics Models
                                                                                                                                                    • ☰ 13. Production Cuts and Transport Parameters
                                                                                                                                                      • ☰ 13.1. What Are Production Cuts?
                                                                                                                                                        • ☰ 13.2. Range Cuts
                                                                                                                                                          • ☰ 13.3. Region-Based Cuts
                                                                                                                                                            • ☰ 13.4. Accuracy vs Performance
                                                                                                                                                            • ☰ 14. Actors
                                                                                                                                                              • ☰ 14.1. What Is an Actor?
                                                                                                                                                                • ☰ 14.2. Simulation Statistics Actor
                                                                                                                                                                  • ☰ 14.3. Energy Deposition Actor
                                                                                                                                                                    • ☰ 14.4. Dose Actor
                                                                                                                                                                      • ☰ 14.5. Phase Space Actor
                                                                                                                                                                        • ☰ 14.6. Particle Fluence
                                                                                                                                                                          • ☰ 14.7. Actor Filters
                                                                                                                                                                          • ☰ 15. Dose Calculation
                                                                                                                                                                            • ☰ 15.1. Energy Deposition
                                                                                                                                                                              • ☰ 15.2. Absorbed Dose
                                                                                                                                                                                • ☰ 15.3. Creating a Dose Actor
                                                                                                                                                                                  • ☰ 15.4. Dose Images
                                                                                                                                                                                    • ☰ 15.5. Statistical Uncertainty
                                                                                                                                                                                      • ☰ 15.6. Dose Profiles
                                                                                                                                                                                      • ☰ 16. Hits and Detector Response
                                                                                                                                                                                        • ☰ 16.1. Particle Interactions in Detectors
                                                                                                                                                                                          • ☰ 16.2. Hits
                                                                                                                                                                                            • ☰ 16.3. Hit Collections
                                                                                                                                                                                              • ☰ 16.4. Hit Attributes
                                                                                                                                                                                                • ☰ 16.5. Hits vs Detector Signals
                                                                                                                                                                                                • ☰ 17. Digitizers
                                                                                                                                                                                                  • ☰ 17.1. What Is Digitization?
                                                                                                                                                                                                    • ☰ 17.2. Digitizer Chain
                                                                                                                                                                                                      • ☰ 17.3. Energy Summation
                                                                                                                                                                                                        • ☰ 17.4. Readout
                                                                                                                                                                                                          • ☰ 17.5. Energy Blurring
                                                                                                                                                                                                            • ☰ 17.6. Spatial Blurring
                                                                                                                                                                                                              • ☰ 17.7. Energy Thresholds
                                                                                                                                                                                                                • ☰ 17.8. Time Blurring
                                                                                                                                                                                                                • ☰ 18. Singles
                                                                                                                                                                                                                  • ☰ 18.1. What Are Singles?
                                                                                                                                                                                                                    • ☰ 18.2. Creating Singles
                                                                                                                                                                                                                      • ☰ 18.3. Detector Identification
                                                                                                                                                                                                                        • ☰ 18.4. Energy Windows
                                                                                                                                                                                                                          • ☰ 18.5. Analyzing Singles
                                                                                                                                                                                                                          • ☰ 19. Coincidences
                                                                                                                                                                                                                            • ☰ 19.1. What Are Coincidences?
                                                                                                                                                                                                                              • ☰ 19.2. Coincidence Sorting
                                                                                                                                                                                                                                • ☰ 19.3. True Coincidences
                                                                                                                                                                                                                                  • ☰ 19.4. Scattered Coincidences
                                                                                                                                                                                                                                    • ☰ 19.5. Random Coincidences
                                                                                                                                                                                                                                      • ☰ 19.6. Coincidence Timing
                                                                                                                                                                                                                                        • ☰ 19.7. Coincidence Output
                                                                                                                                                                                                                                        • ☰ 20. Data Output
                                                                                                                                                                                                                                          • ☰ 20.1. Simulation Output
                                                                                                                                                                                                                                            • ☰ 20.2. ROOT Output
                                                                                                                                                                                                                                              • ☰ 20.3. Image Output
                                                                                                                                                                                                                                                • ☰ 20.4. Text-Based Output
                                                                                                                                                                                                                                                  • ☰ 20.5. Organizing Simulation Results
                                                                                                                                                                                                                                                  • ☰ 21. GATE and ROOT
                                                                                                                                                                                                                                                    • ☰ 21.1. Reading GATE ROOT Files
                                                                                                                                                                                                                                                      • ☰ 21.2. Inspecting Output
                                                                                                                                                                                                                                                        • ☰ 21.3. Energy Histograms
                                                                                                                                                                                                                                                          • ☰ 21.4. Time Histograms
                                                                                                                                                                                                                                                            • ☰ 21.5. Detector Maps
                                                                                                                                                                                                                                                              • ☰ 21.6. Filtering Events
                                                                                                                                                                                                                                                              • ☰ 22. GATE and Python Data Analysis
                                                                                                                                                                                                                                                                • ☰ 22.1. Reading Simulation Output with Python
                                                                                                                                                                                                                                                                  • ☰ 22.2. Energy Spectra
                                                                                                                                                                                                                                                                    • ☰ 22.3. Position Distributions
                                                                                                                                                                                                                                                                      • ☰ 22.4. Timing Analysis
                                                                                                                                                                                                                                                                        • ☰ 22.5. Statistical Analysis
                                                                                                                                                                                                                                                                          • ☰ 22.6. Visualization
                                                                                                                                                                                                                                                                          • ☰ 23. Voxelized Geometry
                                                                                                                                                                                                                                                                            • ☰ 23.1. Introduction to Voxelized Geometry
                                                                                                                                                                                                                                                                              • ☰ 23.2. Image-Based Volumes
                                                                                                                                                                                                                                                                                • ☰ 23.3. Material Mapping
                                                                                                                                                                                                                                                                                  • ☰ 23.4. CT-to-Material Conversion
                                                                                                                                                                                                                                                                                    • ☰ 23.5. Patient Geometry
                                                                                                                                                                                                                                                                                      • ☰ 23.6. Visualizing Voxelized Geometry
                                                                                                                                                                                                                                                                                      • ☰ 24. Image and DICOM Data
                                                                                                                                                                                                                                                                                        • ☰ 24.1. Medical Image Formats
                                                                                                                                                                                                                                                                                          • ☰ 24.2. Reading CT Images
                                                                                                                                                                                                                                                                                            • ☰ 24.3. DICOM CT Data
                                                                                                                                                                                                                                                                                              • ☰ 24.4. RT Structure Sets
                                                                                                                                                                                                                                                                                                • ☰ 24.5. RT Plans
                                                                                                                                                                                                                                                                                                  • ☰ 24.6. Coordinate Systems
                                                                                                                                                                                                                                                                                                  • ☰ 25. Motion and Time-Dependent Simulations
                                                                                                                                                                                                                                                                                                    • ☰ 25.1. Time in GATE
                                                                                                                                                                                                                                                                                                      • ☰ 25.2. Moving Sources
                                                                                                                                                                                                                                                                                                        • ☰ 25.3. Moving Detectors
                                                                                                                                                                                                                                                                                                          • ☰ 25.4. Respiratory Motion
                                                                                                                                                                                                                                                                                                            • ☰ 25.5. Scanner Rotation
                                                                                                                                                                                                                                                                                                              • ☰ 25.6. Dynamic Imaging
                                                                                                                                                                                                                                                                                                              • ☰ 26. PET Simulation Fundamentals
                                                                                                                                                                                                                                                                                                                • ☰ 26.1. PET Physics
                                                                                                                                                                                                                                                                                                                  • ☰ 26.2. PET Scanner Components
                                                                                                                                                                                                                                                                                                                    • ☰ 26.3. PET Detector Geometry
                                                                                                                                                                                                                                                                                                                      • ☰ 26.4. PET Source
                                                                                                                                                                                                                                                                                                                        • ☰ 26.5. PET Physics Configuration
                                                                                                                                                                                                                                                                                                                          • ☰ 26.6. PET Detector Response
                                                                                                                                                                                                                                                                                                                          • ☰ 27. Building a PET Scanner
                                                                                                                                                                                                                                                                                                                            • ☰ 27.1. Creating the Detector Ring
                                                                                                                                                                                                                                                                                                                              • ☰ 27.2. Creating Detector Blocks
                                                                                                                                                                                                                                                                                                                                • ☰ 27.3. Creating Detector Crystals
                                                                                                                                                                                                                                                                                                                                  • ☰ 27.4. Assigning Detector IDs
                                                                                                                                                                                                                                                                                                                                    • ☰ 27.5. Adding a PET Source
                                                                                                                                                                                                                                                                                                                                      • ☰ 27.6. Configuring the Digitizer
                                                                                                                                                                                                                                                                                                                                        • ☰ 27.7. Running the PET Simulation
                                                                                                                                                                                                                                                                                                                                        • ☰ 28. PET Coincidence Analysis
                                                                                                                                                                                                                                                                                                                                          • ☰ 28.1. Coincidence Events
                                                                                                                                                                                                                                                                                                                                            • ☰ 28.2. Energy Selection
                                                                                                                                                                                                                                                                                                                                              • ☰ 28.3. Coincidence Time Window
                                                                                                                                                                                                                                                                                                                                                • ☰ 28.4. Lines of Response
                                                                                                                                                                                                                                                                                                                                                  • ☰ 28.5. True Events
                                                                                                                                                                                                                                                                                                                                                    • ☰ 28.6. Scatter Events
                                                                                                                                                                                                                                                                                                                                                      • ☰ 28.7. Random Events
                                                                                                                                                                                                                                                                                                                                                        • ☰ 28.8. PET Performance Metrics
                                                                                                                                                                                                                                                                                                                                                        • ☰ 29. Time-of-Flight PET
                                                                                                                                                                                                                                                                                                                                                          • ☰ 29.1. TOF PET Principles
                                                                                                                                                                                                                                                                                                                                                            • ☰ 29.2. Detector Timing Resolution
                                                                                                                                                                                                                                                                                                                                                              • ☰ 29.3. Time Difference
                                                                                                                                                                                                                                                                                                                                                                • ☰ 29.4. Timing Blurring
                                                                                                                                                                                                                                                                                                                                                                  • ☰ 29.5. Analyzing TOF Events
                                                                                                                                                                                                                                                                                                                                                                  • ☰ 30. SPECT Simulation Fundamentals
                                                                                                                                                                                                                                                                                                                                                                    • ☰ 30.1. SPECT Physics
                                                                                                                                                                                                                                                                                                                                                                      • ☰ 30.2. SPECT Scanner Components
                                                                                                                                                                                                                                                                                                                                                                        • ☰ 30.3. SPECT Radionuclides
                                                                                                                                                                                                                                                                                                                                                                          • ☰ 30.4. Gamma Camera Geometry
                                                                                                                                                                                                                                                                                                                                                                            • ☰ 30.5. SPECT Source
                                                                                                                                                                                                                                                                                                                                                                            • ☰ 31. Building a Gamma Camera
                                                                                                                                                                                                                                                                                                                                                                              • ☰ 31.1. Detector Head
                                                                                                                                                                                                                                                                                                                                                                                • ☰ 31.2. Collimator
                                                                                                                                                                                                                                                                                                                                                                                  • ☰ 31.3. Shielding
                                                                                                                                                                                                                                                                                                                                                                                    • ☰ 31.4. Energy Resolution
                                                                                                                                                                                                                                                                                                                                                                                      • ☰ 31.5. Energy Window
                                                                                                                                                                                                                                                                                                                                                                                        • ☰ 31.6. Projection Data
                                                                                                                                                                                                                                                                                                                                                                                        • ☰ 32. SPECT Acquisition
                                                                                                                                                                                                                                                                                                                                                                                          • ☰ 32.1. Rotating Gamma Camera
                                                                                                                                                                                                                                                                                                                                                                                            • ☰ 32.2. Projection Angles
                                                                                                                                                                                                                                                                                                                                                                                              • ☰ 32.3. Acquisition Time
                                                                                                                                                                                                                                                                                                                                                                                                • ☰ 32.4. Energy Windows
                                                                                                                                                                                                                                                                                                                                                                                                  • ☰ 32.5. Projection Images
                                                                                                                                                                                                                                                                                                                                                                                                    • ☰ 32.6. SPECT Data Analysis
                                                                                                                                                                                                                                                                                                                                                                                                    • ☰ 33. CT and X-Ray Simulation
                                                                                                                                                                                                                                                                                                                                                                                                      • ☰ 33.1. X-Ray Physics
                                                                                                                                                                                                                                                                                                                                                                                                        • ☰ 33.2. X-Ray Source
                                                                                                                                                                                                                                                                                                                                                                                                          • ☰ 33.3. CT Geometry
                                                                                                                                                                                                                                                                                                                                                                                                            • ☰ 33.4. Detector Array
                                                                                                                                                                                                                                                                                                                                                                                                              • ☰ 33.5. Rotating CT Geometry
                                                                                                                                                                                                                                                                                                                                                                                                                • ☰ 33.6. CT Projection Data
                                                                                                                                                                                                                                                                                                                                                                                                                • ☰ 34. Radiation Therapy Simulation
                                                                                                                                                                                                                                                                                                                                                                                                                  • ☰ 34.1. External Beam Radiotherapy
                                                                                                                                                                                                                                                                                                                                                                                                                    • ☰ 34.2. Photon Beams
                                                                                                                                                                                                                                                                                                                                                                                                                      • ☰ 34.3. Electron Beams
                                                                                                                                                                                                                                                                                                                                                                                                                        • ☰ 34.4. Dose Calculation
                                                                                                                                                                                                                                                                                                                                                                                                                          • ☰ 34.5. Beam Geometry
                                                                                                                                                                                                                                                                                                                                                                                                                            • ☰ 34.6. Dose Validation
                                                                                                                                                                                                                                                                                                                                                                                                                            • ☰ 35. Proton Therapy Simulation
                                                                                                                                                                                                                                                                                                                                                                                                                              • ☰ 35.1. Proton Physics
                                                                                                                                                                                                                                                                                                                                                                                                                                • ☰ 35.2. Proton Beam
                                                                                                                                                                                                                                                                                                                                                                                                                                  • ☰ 35.3. Water Phantom
                                                                                                                                                                                                                                                                                                                                                                                                                                    • ☰ 35.4. Bragg Peak
                                                                                                                                                                                                                                                                                                                                                                                                                                      • ☰ 35.5. Spread-Out Bragg Peak
                                                                                                                                                                                                                                                                                                                                                                                                                                        • ☰ 35.6. Proton Dose Analysis
                                                                                                                                                                                                                                                                                                                                                                                                                                        • ☰ 36. Internal Dosimetry
                                                                                                                                                                                                                                                                                                                                                                                                                                          • ☰ 36.1. Radioactive Sources in the Body
                                                                                                                                                                                                                                                                                                                                                                                                                                            • ☰ 36.2. Voxelized Activity Maps
                                                                                                                                                                                                                                                                                                                                                                                                                                              • ☰ 36.3. Energy Deposition
                                                                                                                                                                                                                                                                                                                                                                                                                                                • ☰ 36.4. Dose Maps
                                                                                                                                                                                                                                                                                                                                                                                                                                                  • ☰ 36.5. Radionuclide Therapy
                                                                                                                                                                                                                                                                                                                                                                                                                                                    • ☰ 36.6. Dose Analysis
                                                                                                                                                                                                                                                                                                                                                                                                                                                    • ☰ 37. Optical Photon Simulation
                                                                                                                                                                                                                                                                                                                                                                                                                                                      • ☰ 37.1. Optical Physics
                                                                                                                                                                                                                                                                                                                                                                                                                                                        • ☰ 37.2. Scintillation
                                                                                                                                                                                                                                                                                                                                                                                                                                                          • ☰ 37.3. Optical Properties
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • ☰ 37.4. Optical Surfaces
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • ☰ 37.5. Photodetectors
                                                                                                                                                                                                                                                                                                                                                                                                                                                                • ☰ 37.6. Optical Photon Detection
                                                                                                                                                                                                                                                                                                                                                                                                                                                                • ☰ 38. Phase-Space Data
                                                                                                                                                                                                                                                                                                                                                                                                                                                                  • ☰ 38.1. What Is a Phase Space?
                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • ☰ 38.2. Recording Phase-Space Data
                                                                                                                                                                                                                                                                                                                                                                                                                                                                      • ☰ 38.3. Phase-Space Files
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        • ☰ 38.4. Phase-Space Sources
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          • ☰ 38.5. Applications
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          • ☰ 39. Random Numbers and Reproducibility
                                                                                                                                                                                                                                                                                                                                                                                                                                                                            • ☰ 39.1. Monte Carlo Random Numbers
                                                                                                                                                                                                                                                                                                                                                                                                                                                                              • ☰ 39.2. Random Seeds
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                • ☰ 39.3. Independent Simulations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  • ☰ 39.4. Reproducible Research
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  • ☰ 40. Multithreading and Performance
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • ☰ 40.1. Multithreaded Simulation
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      • ☰ 40.2. Selecting the Number of Threads
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        • ☰ 40.3. Simulation Speed
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          • ☰ 40.4. Optimizing Geometry
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            • ☰ 40.5. Optimizing Output
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              • ☰ 40.6. Large Simulations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              • ☰ 41. Running GATE on HPC Systems
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                • ☰ 41.1. Why Use HPC?
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  • ☰ 41.2. Running GATE Without Visualization
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • ☰ 41.3. Job Scripts
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      • ☰ 41.4. Running with Slurm
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        • ☰ 41.5. Running Multiple Simulations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          • ☰ 41.6. Combining Results
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          • ☰ 42. Simulation Validation
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            • ☰ 42.1. Why Validate a GATE Simulation?
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              • ☰ 42.2. Geometry Validation
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                • ☰ 42.3. Physics Validation
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  • ☰ 42.4. Comparing with Analytical Models
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • ☰ 42.5. Comparing with Experimental Data
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      • ☰ 42.6. Statistical Validation
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      • ☰ 43. Debugging GATE Simulations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        • ☰ 43.1. Python Errors
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          • ☰ 43.2. Geometry Problems
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            • ☰ 43.3. Material Errors
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              • ☰ 43.4. Source Problems
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                • ☰ 43.5. Physics Problems
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  • ☰ 43.6. Actor Problems
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • ☰ 43.7. Digitizer Problems
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      • ☰ 43.8. Performance Problems
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      • ☰ 44. Writing Better GATE Simulations
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        • ☰ 44.1. Organizing Simulation Scripts
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          • ☰ 44.2. Configuration Files
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            • ☰ 44.3. Avoiding Hard-Coded Values
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              • ☰ 44.4. Reusable Components
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                • ☰ 44.5. Output Organization
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  • ☰ 44.6. Documentation
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • ☰ 44.7. Version Control
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • ☰ 45. Practical Example: Gamma-Ray Detector
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      • ☰ 45.1. Project Overview
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        • ☰ 45.2. Creating the World
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          • ☰ 45.3. Creating the Detector
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            • ☰ 45.4. Creating a Gamma Source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              • ☰ 45.5. Configuring Electromagnetic Physics
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                • ☰ 45.6. Recording Energy Deposition
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  • ☰ 45.7. Adding Energy Resolution
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • ☰ 45.8. Creating an Energy Spectrum
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      • ☰ 45.9. Analyzing the Spectrum
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      • ☰ 46. Practical Example: Radiation Shielding
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        • ☰ 46.1. Project Overview
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          • ☰ 46.2. Creating the Source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            • ☰ 46.3. Creating the Shield
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              • ☰ 46.4. Selecting Shielding Materials
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                • ☰ 46.5. Changing Shield Thickness
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  • ☰ 46.6. Recording Transmitted Photons
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • ☰ 46.7. Calculating Transmission
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      • ☰ 46.8. Calculating Attenuation
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        • ☰ 46.9. Comparing with the Exponential Attenuation Law
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        • ☰ 47. Practical Example: PET Scanner
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          • ☰ 47.1. Project Overview
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            • ☰ 47.2. Creating the PET Ring
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              • ☰ 47.3. Creating Detector Modules
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                • ☰ 47.4. Creating Detector Crystals
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  • ☰ 47.5. Adding an F-18 Source
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • ☰ 47.6. Configuring PET Physics
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      • ☰ 47.7. Recording Hits
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        • ☰ 47.8. Creating Singles
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          • ☰ 47.9. Applying Energy Blurring
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            • ☰ 47.10. Applying the PET Energy Window
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              • ☰ 47.11. Sorting Coincidences
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                • ☰ 47.12. Identifying True Coincidences
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  • ☰ 47.13. Identifying Scattered Coincidences
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    • ☰ 47.14. Creating Lines of Response
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      • ☰ 47.15. Saving PET Data