7.1. Nested Volumes
Table of Contents
Parent-child relationships
In GATE, every volume except the world lives inside a parent volume. This hierarchy of parent and child volumes is what allows you to build complex geometry from simple shapes. A child volume is entirely contained inside its parent, and its position and rotation are defined relative to the parent coordinate system, not the global coordinates of the world.
The key idea is that once you attach a volume as a child to some parent, you are working inside the parent reference frame. If the parent is translated or rotated with respect to the world, all its children follow automatically. This simplifies the construction of repeated modules and realistic detector assemblies, because you do not have to compute separate global coordinates for every single piece.
Conceptually, you can think of the hierarchy as a tree. The world is the root. Each volume has exactly one parent but can have many children. A simple structure might be: world contains a scanner housing volume, the scanner housing contains several detector modules, and each detector module contains crystals, light guides, and support materials. The same principle also applies to phantoms or mechanical components such as collimators and shielding layers.
In OpenGATE Python scripts, you usually create a logical volume by specifying a name, a shape, and a material, then assign a parent and a placement. For example, if you create a box called "Module" and set its parent to "Scanner", its position coordinates are interpreted in the scanner coordinate system. Inside that module, you may place crystals using coordinates that are only meaningful inside the module. This nested approach keeps dimensions local and easy to manage.
A fundamental constraint is that a child must fit entirely inside its parent, including any rotation. If a child volume crosses the boundary of its parent, Geant4 reports overlaps or places the geometry in an undefined way. Complex hierarchies therefore require careful planning of sizes and placements so that each level in the hierarchy properly encloses its children. Visual inspection can help confirm that your parent and child relationships are consistent and that no volume unintentionally sticks out of its container.
You can assign materials independently at each level of the hierarchy. The parent material does not automatically override the child material. For example, an aluminum housing volume can contain LYSO crystals and air gaps as children. Particle tracking and interactions always follow the actual material of the volume in which the particle is currently located, regardless of the materials of any parents or siblings.
Every volume except the world must have exactly one parent, and the child must be fully contained inside that parent. Child positions and rotations are always defined in the coordinate system of the parent volume.
Nested volumes are also important for region-based physics settings and production cuts, which are typically defined per volume or per group of volumes. By grouping subcomponents under a common parent, you can apply specialized physics or transport parameters to that region without affecting the rest of the simulation. For instance, a parent volume that represents a detector head can be assigned different production cuts than a phantom volume.
When you design a new geometry, it is useful to think in terms of modules and submodules. Each module is a parent that collects related children. This not only mirrors the physical construction of real devices but also makes the code more maintainable. If you need to change the size or placement of a module, all the children automatically adjust because their relative positions remain unchanged inside their parent coordinate system. This is one of the most powerful aspects of nested volumes in GATE.
Detector components
Nested volumes become particularly useful when you simulate realistic detector systems. Modern medical imaging detectors have a clear structural hierarchy, and you can map this physical hierarchy directly into your GATE volume hierarchy. For example, a PET scanner typically consists of rings, which contain detector modules, which contain crystal arrays, which may in turn be coupled to light guides and photodetectors. Each of these levels is represented as a parent volume that contains more detailed children.
A common pattern is to start with a large parent volume that represents the scanner or detector head. Inside this parent, you place intermediate components such as modules, blocks, or sectors. Inside each module you then place the smallest detector elements such as scintillation crystals or silicon sensors. This results in a consistent and reusable design: you define the geometry of one module and then repeat that module many times at the parent level rather than defining each crystal separately in global coordinates.
The spatial relationships between components are all local. For instance, within a PET detector module, you can define a regular grid of crystals using positions that are easy to specify relative to the module center. The module itself can then be rotated and placed around a ring by the parent volume that represents the ring. Since the crystals are children of the module, they automatically take on the correct global position and rotation. This hierarchical placement greatly reduces the chance of positional mistakes.
You can use nested volumes to represent non-sensitive components as well. Collimators, mechanical supports, shielding elements, and light-tight housings can all be children of a detector head volume. This maintains a tidy geometry tree and makes it straightforward to enable or disable groups of components by modifying a single parent or by adjusting a function that builds a specific part of the detector.
In a gamma camera, the parent-child structure might be: world contains a gamma camera head, the camera head contains a parallel hole collimator and a NaI crystal, and the crystal may contain optical surfaces or segmentation volumes that represent readout channels. Even if you treat the crystal as a single block for energy deposition, nested volumes allow you to integrate other structures such as protective windows or coupling layers without reworking the entire world geometry.
From a data analysis perspective, actors and digitizers can rely on volume names and identifiers that reflect this hierarchy. For example, hit information can include the name or copy number of the smallest volume that recorded the interaction, such as a specific crystal. Because each crystal is a child of a module and each module is a child of a ring, you can reconstruct higher level information like which ring or module was hit based on the hierarchy. This is essential for building singles and coincidences in PET or for mapping counts to detector channels in SPECT and CT.
Nested detector components also support parameterization. You can write functions that construct one detector module with a given set of parameters, such as crystal size, material, or number of elements, and then instantiate that module multiple times inside a parent ring or detector head volume. When you later modify the module definition, all instances automatically reflect the change. The clear parent-child organization is what makes this kind of reuse practical and robust.
Finally, careful use of nested volumes simplifies debugging. If you see a problem such as missing hits in one region of the detector, you can inspect the corresponding parent volume and its children to check sizes, overlaps, and material assignments. Because each level of the hierarchy is logically separated, it becomes easier to isolate and correct mistakes in complex detector designs without touching unrelated parts of the geometry.
Views: 12
KAHIBARO