25.2. Creating a PET Detector Ring
Table of Contents
Understanding the Role of the Detector Ring
In a PET scanner, the detector ring surrounds the patient and captures the two 511 keV annihilation photons that are emitted almost back to back. For a first simulation, you only need a simple, idealized ring. Its main purpose is to give each detector crystal a known position around the scanner axis, so that lines of response can later be defined from pairs of hits in opposite detectors.
In this chapter you focus on how to build the ring geometry itself: how to decide its dimensions, how to place detector modules in a circle using Geant4 geometry tools, and how to structure your classes so the ring is easy to query and to connect to sensitive detectors in later chapters. Details such as scintillator materials, optical photons or readout electronics are handled by other chapters, so here you keep the ring relatively simple and abstract.
Choosing a Simple Ring Geometry
For beginners it is wise to start with a 2D ring in the transverse plane, that is, in the $x$–$y$ plane around the $z$ axis. You can imagine the patient would lie along the $z$ axis, but initially you can ignore any axial extent and focus on a single ring of crystals.
A minimal description of the ring includes three sets of parameters:
- The ring radius. This is the distance from the scanner axis to the center of each detector crystal. It should be much smaller than the world size but large enough to leave room for the patient region if you add it later. For instance, a radius of 40 cm in a world of a few meters is typical for a simple model.
- The axial length of the ring. For a single ring, you can make it a short band along $z$, for example 2 cm or 5 cm. This corresponds to the length of the detector module in the axial direction.
- The number and size of detector crystals around the ring. You need to decide how many crystals you want and how wide each crystal is. These two choices together determine how densely the ring is populated. A common beginner choice is something like 32, 64, or 128 crystals spaced uniformly in angle.
For a simple conceptual model, you can treat each detector module as a rectangular box and ignore support structures. Each box then has three dimensions: radial thickness (from patient toward outside), tangential width (along the ring) and axial length (along the scanner axis). The center of each box lies on a circle of the chosen radius and the box is rotated so that its largest face is pointing toward the center of the scanner.
You can express the angular separation between neighboring crystals as
$$
\Delta \phi = \frac{2\pi}{N_{\text{crystals}}}
$$
where $N_{\text{crystals}}$ is the number of detector modules in the ring. The center of crystal $i$ then lies at angle
$$
\phi_i = i \, \Delta \phi \quad \text{for} \quad i = 0, 1, \ldots, N_{\text{crystals}}-1 .
$$
The radial coordinate of each center is simply the ring radius. In Cartesian coordinates, the positions become
$$
x_i = R \cos\phi_i, \quad y_i = R \sin\phi_i, \quad z_i = 0 .
$$
This gives you the basic recipe for placing volumes around a ring.
The detector centers must lie inside the world volume and must not overlap with the world boundary. Always choose a ring radius and detector size that clearly fit inside the world dimensions.
Defining Detector Module Volumes
Once you have decided on a radius and number of crystals, you need a Geant4 solid and logical volume that represent a single detector module. You can start with a generic box using G4Box. For example, suppose you choose:
- radial thickness: a few centimeters
- tangential width: such that all modules fit around the ring
- axial length: the axial dimension of the ring
If you call these half sizes $dr, $dt, and $dz in Geant4, you would use them in the G4Box constructor. Remember that Geant4 uses half lengths in its constructors, so if your full crystal width is 4 mm, the half width is 2 mm.
Although in a real PET detector the crystal might be made of a scintillator like LYSO and wrapped in a reflector, for the purpose of constructing the ring you can temporarily assign a simple placeholder material, for example a standard NIST material such as G4_Lu2SiO5 if you wish to already approximate LYSO, or just G4_WATER if you have not yet decided about realistic material properties. The key is to have a valid G4LogicalVolume for the crystal that you can place repeatedly.
You can store a pointer to this G4LogicalVolume as a member of your detector construction class so that you can easily assign a sensitive detector to it in a later chapter. It is also useful to give it a clear, descriptive name when creating it, since this name will appear in visualization and can help with debugging.
Always remember that Geant4 shape constructors take half lengths, not full lengths. A common source of geometry errors is forgetting this and accidentally making crystals twice as large as intended.
Placing Crystals Around the Ring
With a logical detector volume defined, the main task of building a PET ring is to place many copies of that logical volume in the world so that they form a circle. This is done through repeated G4PVPlacement calls, one for each crystal, each with a unique rotation and translation.
The translation comes from the circular coordinates. For each crystal index $i$ you compute $x_i$, $y_i$, and $z_i$ as described earlier, and construct a G4ThreeVector with those values in Geant4 units, typically mm or cm. The axial coordinate can initially be zero for a single ring centered at $z = 0$.
In addition to the translation, you want each crystal to be oriented so its flat face looks toward the scanner center. To achieve that, you must define a rotation matrix for each placement. You can do this using G4RotationMatrix. For a ring in the $x$–$y$ plane, a rotation around the $z$ axis by the angle $\phi_i$ or by $\phi_i + \pi/2$ is commonly used, depending on how you define the crystal dimensional axes. The goal is that the long axis of the crystal points radially inward or outward, and the tangential width aligns with the ring circumference.
A typical pattern is to fill a loop over the crystal index and, for each element, construct its own G4RotationMatrix and G4ThreeVector. You then pass these objects to the G4PVPlacement constructor, along with a unique copy number, which will later be used as the detector ID.
Although Geant4 has more advanced concepts such as replicas and parameterized volumes, for a first PET ring it is often clearer to explicitly place each crystal. This makes the geometry code more transparent and easier to connect with detector IDs in later chapters, even though it is less compact than a parameterized solution.
Every detector module in the ring must have a unique copy number in G4PVPlacement. This copy number is how you will later identify which detector element recorded a hit.
Using Rotation Matrices for Ring Geometry
The correct use of rotation matrices is essential for a realistic PET ring. Without rotation, every crystal would have the same orientation, and the ring would look like a circle of misaligned boxes when visualized.
Geant4 uses G4RotationMatrix to represent orientations. A rotation matrix can be created and then rotated around one or more axes. For a PET ring, you usually need a rotation around the $z$ axis by an amount that depends on the detector index. As the index increases, the orientation rotates around the circle.
Conceptually, you choose an angle $\phi_i$ and construct a rotation that aligns one axis of the detector with the radial direction. If your crystal is defined in its own local frame so that, for example, its long axis is along local $x$, then you can rotate the world $z$ axis or the local axes until that long axis points outwards. In practice, you may need to experiment with sign conventions and the orientation of your solid to obtain the desired effect. Visualization is very helpful here, because you can immediately see whether the crystals are pointing toward the center or are rotated incorrectly.
If you have not used rotations in Geant4 before, start by rotating around only one axis and use simple angles like 0, 90, 180, and 270 degrees for a small number of crystals to understand how rotations affect placement. After that, generalize to the full ring with many crystals.
Always verify your rotation setup with visualization before relying on the geometry. Slight mistakes in sign or axis choice can result in crystals pointing in the wrong direction, which will later affect detector response and line of response reconstruction.
Detector Indexing in the Ring
The copy number assigned to each G4PVPlacement serves as a natural detector index in the ring. By using the loop index as the copy number, you create a one to one mapping between angular position and detector ID. This is extremely useful for later analysis, because you can map a hit in detector $i$ to an angle $\phi_i$ and to coordinates on the ring.
In a basic single ring, the simplest convention is:
- Use the loop index $i$ directly as the copy number.
- Define $\phi_i$ so that crystal 0 is at some reference angle, for example along the positive $x$ axis, and the angle increases in the mathematical positive direction, counterclockwise in the $x$–$y$ plane.
With this choice, you can easily convert from detector ID to position later in your analysis or in higher level PET event reconstruction code. If you eventually build multiple rings along the $z$ axis, you can extend the indexing scheme to include both a ring index and a crystal index, for example by using a two dimensional indexing scheme packed into a single integer or by using separate copy numbers and replication schemes.
In this introductory example, you do not need to implement a full indexing strategy for multiple rings, but it is helpful to think ahead and choose a consistent convention now, because changing detector IDs later can be tedious.
Choose and document a clear mapping between detector index and position in the ring at the start of your project. This mapping will be used in coincidence finding, line of response calculation, and ROOT analysis in later chapters.
Visualizing and Checking the PET Ring
After you implement the PET ring geometry, it is important to display it using the Geant4 visualization system and inspect it from several angles. A correct ring should appear as a closed circle of equally spaced crystals with no obvious overlap or gaps outside your design.
You can use /vis/open to start a viewer and /vis/drawVolume to show the geometry. If you give the crystal logical volume a distinct color and possibly adjust its transparency, you can quickly confirm their orientation and placement. It is helpful to zoom in and rotate around the ring to check that each individual detector module is rotated consistently and that neighboring modules meet at the right angles.
If something looks wrong, for example crystals appear tilted or spaced incorrectly, check the rotation matrices and angular spacing formula. Visualization is often the fastest way to find such geometry mistakes before you start running simulations.
By the end of this chapter, you should have a working PET detector ring in your Geant4 simulation, composed of a world volume and a circular arrangement of simple detector modules. This ring will form the geometric basis for the positron source, annihilation photon tracking, detector hits, and coincidence analysis that you will build in the subsequent PET scanner chapters.
Views: 9
KAHIBARO