47.2. Creating the PET Ring
Table of Contents
Understanding the Role of the PET Ring
In a PET scanner, the detector ring is the central geometric component that surrounds the patient or phantom. It is a circular arrangement of detector elements that detect the two annihilation photons emitted in almost opposite directions. When you create the PET ring in GATE, you define where the detectors are in space, how many there are, and how they are distributed around the field of view. All later steps, such as adding detector modules, crystals, and digitizers, will assume that this ring geometry is already correctly defined.
In this chapter, you will focus only on the ring itself, not on the internal structure of each detector module or crystal. Those details are addressed in later chapters about detector modules and crystals. Here, you create a clean, simple ring that can later be populated with more complex detector volumes.
Choosing Basic Ring Parameters
Before you write any code, you must choose some fundamental ring parameters. At a minimum, you need a ring radius (or diameter), an axial length, and a number of detector elements around the ring. For a beginner example, it is helpful to work with approximate, round values and not worry about matching a specific commercial PET scanner.
The ring radius is the distance from the center of the scanner, usually the origin of your world volume, to the center of each detector module on the ring. A typical whole body PET scanner has an inner ring diameter of several tens of centimeters, which corresponds to a radius of about 40 cm. For a simple training example, you might pick a ring radius of $40 \,\text{cm}$ or $430 \,\text{mm}$.
The ring axial length defines how long the scanner is along the patient axis, usually the $z$ axis. For a basic 2D like ring, you can make a ring that is only as long as one row of detector modules, for example $200 \,\text{mm}$ or $250 \,\text{mm}$. If you later decide to create several rings stacked along $z$, you will extend this concept, but for now a single axial segment is enough.
Finally, the number of detectors around the ring, usually the number of repeated modules, determines the angular sampling. If you use $N$ detector modules distributed uniformly around a full circle, the angular step between neighbors is
$$
\Delta\phi = \frac{360^\circ}{N}.
$$
An integer number such as 32, 48, 64, or 96 modules is convenient. More modules mean better angular sampling and a more realistic scanner, but also more computation and larger output.
A PET ring is characterized by:
- Ring radius (or diameter) that sets the distance from center to detectors.
- Axial length, usually along the $z$ axis.
- Number of detector modules, which sets the angular step $\Delta\phi = 360^\circ / N$.
Always choose values that are consistent with your world size and your planned detector dimensions.
Placing Volumes on a Ring in GATE
In OpenGATE, you rarely place every detector module manually using separate positions and rotations. Instead, you typically define a single detector module prototype volume and then use a repetition mechanism to create many copies around a ring. You will use this approach in the next chapter when you define detector modules. In this chapter, however, it is helpful to understand what the repetition will do geometrically.
Conceptually, each detector module sits at a position on the circumference of a circle of radius $R_\text{ring}$ in the transverse plane. If you assume the ring lies in the $x$–$y$ plane and is centered at $(0,0,0)$, then the center of the $i$-th module around the ring, with index $i$ starting at 0, is at
$$
x_i = R_\text{ring} \cos(\phi_i), \quad
y_i = R_\text{ring} \sin(\phi_i), \quad
z_i = 0,
$$
where
$$
\phi_i = i \cdot \Delta\phi, \quad
\Delta\phi = \frac{2\pi}{N}.
$$
The module also needs an orientation so that its face looks toward the center. This means that the module local $z$ axis (or its main detection face) should point radially inwards. In GATE, when you use a ring repetition, the framework automatically computes these rotations for you, so you do not need to calculate the matrix yourself. However, you should understand that each module is both translated and rotated relative to the world.
If you later create multiple axial rings, you will shift each ring copy along the $z$ axis by a certain step. This will effectively create a cylindrical volume of detectors.
Defining the World and Ring Parent Volume
Before you can place a PET ring, you must have a world volume that is large enough to contain it. The world volume is covered in detail in earlier chapters, so you will not redefine it here. For a PET example, it is sufficient if the world box extends several centimeters beyond the outer edge of the ring in all directions.
Suppose you choose a ring radius of $R_\text{ring} = 430 \,\text{mm}$ and detector modules that are about $20 \,\text{mm}$ thick in the radial direction. Then a world half length of at least $500 \,\text{mm}$ in $x$ and $y$ and a similar or slightly larger extent in $z$ is reasonable. The critical point is that the entire ring and the future patient or phantom geometry fits comfortably inside the world.
You also need to think about which volume will act as the parent for your ring elements. Often, you will attach detector modules directly to the world. In more advanced configurations, you might define an intermediate volume, for example a cylindrical support structure or a gantry, and have all modules be daughters of that volume. For the first PET example, keeping modules as direct children of the world makes the geometry easier to manage and visualize.
Ensure the world volume is large enough to contain:
- The full PET ring radius plus detector thickness.
- The intended phantom or patient volume.
If any part of the ring lies outside the world, the geometry is invalid and the simulation will fail or behave unpredictably.
Ring Geometry Configuration in Python
To define a PET ring in OpenGATE with Python, you will typically start in your main simulation script by creating a simulation object and the world volume, then you will describe the ring parameters in a simple, structured way. The exact Python names and classes can vary with OpenGATE versions, so you should always check the current documentation, but the basic strategy is the same.
First, you define your high level PET ring parameters in your script. For example, you can store them in a small dictionary or as variables at the top of the file:
ring_radius = 430 * gate.g4_units.mm
ring_axial_length = 250 * gate.g4_units.mm
nb_modules = 64Then you will define a single detector module volume. Since the detailed design of modules is covered in the next chapter, you can think of this here as just a rectangular box that later will be refined. For example:
module = sim.add_volume("Box", "pet_module")
module.size = [20 * gate.g4_units.mm,
40 * gate.g4_units.mm,
ring_axial_length]
module.material = "Air"
module.mother = "world"At this point, you still only have one module in the world. To turn this into a ring, you use the repetition mechanism that OpenGATE provides. A ring repetition tells GATE: "Create many copies of this volume placed around a circle with this radius and this number of copies." An example pattern is:
ring_repeat = module.repeaters.add_ring()
ring_repeat.radius = ring_radius
ring_repeat.nb = nb_modules
ring_repeat.first_angle = 0.0
ring_repeat.phi = 360 * gate.g4_units.deg
The details may differ slightly depending on the API version, but the concept is always similar. The radius sets the radial distance from the parent volume center, nb is the number of repeated copies, and you can control the total angular span (typically $360^\circ$ for a full ring) and the starting angle. In this way, you do not manually compute each module position.
At the end of this configuration, you have created a full PET detector ring consisting of nb_modules identical rectangles placed at equal angles around the scanner center. In the next chapters you will replace the simple module box and its material with realistic detector blocks and crystals.
Aligning the Ring with the Scanner Coordinate System
PET simulations usually adopt a clear coordinate convention to keep geometry, sources, and analysis consistent. In most GATE PET examples, the scanner center is at the origin $(0,0,0)$, the $z$ axis is the axial direction of the scanner, and the ring lies in the $x$–$y$ plane. The patient or phantom is placed at or near the center. When you define your ring, you should make sure that the chosen repetition and the world geometry are aligned with this convention.
If you use a ring repeater with the default settings, the first module might be placed on the positive $x$ axis or at some defined starting angle. You can adjust the first_angle parameter if you want a specific orientation. This is often useful when you later want to interpret detector identifiers or compare your simulation to a particular scanner where the numbering of modules starts at a defined angle.
It is also important to ensure that the axial extent of your module matches the planned scanner field of view. Since you defined the module as a box with its longest dimension along $z$, the full axial length is equal to that dimension. In OpenGATE, volumes are usually defined by their full size, not half size, so a module size of [radial, tangential, axial] corresponds directly to those lengths.
Keep your PET ring aligned with a consistent coordinate system:
- Ring center at $(0,0,0)$.
- Ring in the $x$–$y$ plane.
- Axial direction along $z$.
Misalignment at this stage can complicate source placement and data analysis later.
Visualizing and Checking the PET Ring
Once the ring is configured, you should visualize the geometry to confirm that it appears as expected. The visualization chapter explains how to enable viewers and manipulate the camera. For a PET ring, you want to check that:
The ring is centered at the origin and lies in the $x$–$y$ plane.
All modules are evenly distributed around the full circle.
There is no overlap between neighboring modules.
The ring is fully contained inside the world.
If your modules are large in the tangential direction, you may see them touching their neighbors or leaving gaps. This is expected if you have not yet tuned their sizes to match a realistic scanner. For this chapter, the key point is that the repetition logic and the radius are correct. You can later adjust module width and the exact number of modules to achieve a desired coverage or packing factor.
If you see unexpected placements, such as modules along a line instead of a circle, it usually means that the ring repetition was not defined correctly or that the parent volume transformation is not what you expect. Checking the geometry visually is one of the fastest ways to catch such configuration errors before you add complex detector elements and sources.
Preparing the Ring for Further Refinement
By the end of this chapter, you have a ring of simple modules with a chosen radius, axial length, and number of modules. This ring will serve as the scaffold for the more detailed PET detector geometry. In the next chapters, you will replace the simple module content by creating detector blocks and then crystals inside each module. You will also assign detector identifiers, configure physics, and connect the ring to a digitizer chain.
It is useful to keep the ring parameters grouped together in your Python script so that you can modify them easily if you want to compare different scanner designs. For example, you might collect them in a dictionary:
pet_ring = {
"radius": 430 * gate.g4_units.mm,
"axial_length": 250 * gate.g4_units.mm,
"nb_modules": 64,
}Then you can pass this configuration to geometry building functions that construct the ring, blocks, and crystals based on the same set of parameters. This keeps your PET example flexible and ready for future extensions while maintaining a clear separation between the ring structure defined here and the internal detector details handled later.
Views: 13
KAHIBARO