KAHIBARO
Discord Login Register

33.2. X-Ray Source

Source position

In a CT or X‑ray simulation, the first key choice for the X‑ray source is where it sits relative to the object and the detector. In GATE you usually describe the source position in the global coordinate system as a 3D vector, typically in millimeters, using the same units system as the rest of your geometry.

For a fan‑beam or cone‑beam CT setup, the source is often placed on a circle around the object. If the patient or phantom center is at the origin, one common convention is to place the source on the positive or negative $x$ axis and let it rotate around the $z$ axis. For example, a source at $(R, 0, 0)$ is located at a distance $R$ from isocenter along $x$. The exact radius is usually chosen to match the source‑to‑isocenter distance (SID) of your CT scanner.

You configure this position in your GATE Python script by assigning a position vector to the source, after you have defined the world and the scanner geometry so that you know where the patient and detector are. When you simulate rotation for CT, you do not move the patient; instead, you update the source position (and usually the detector position) as a function of projection angle. For each projection angle $\theta$, you can compute a new source position on a circle of radius $R$ as
$$
x(\theta) = R \cos\theta,\quad
y(\theta) = R \sin\theta,\quad
z(\theta) = 0,
$$
or another suitable parametrization that matches your scanner geometry.

In simpler X‑ray simulations, such as a fixed radiography beam, the source position may remain constant throughout the simulation. You only need to make sure that it is far enough from the phantom that the beam covers the region of interest and points toward the detector. For parallel beams, the absolute position is still important for intersection with the geometry, but the beam shape does not diverge, so the exact source‑to‑object distance is chosen according to your experimental setup rather than imaging geometry constraints.

Always check the units when you specify source position. In GATE, most geometry is described in millimeters, so your source position should be something like [0, 500*mm, 0] rather than mixing bare numbers and unit factors. Mismatched units are a common cause of sources appearing far away or completely missing the phantom.

Always express the X‑ray source position in the same coordinate system and units as your geometry, typically millimeters, and verify that the source sits at the intended distance from the isocenter and detector.

Beam direction

Once the source position is set, the next step is to define the direction in which X‑ray photons are emitted. In GATE, the source direction is normally given as a unit vector in 3D space. For a simple fixed beam, you might choose a direction like $(0, 0, 1)$ to send photons along the $+z$ axis toward a detector placed above the phantom.

In a CT geometry, the beam direction must point from the source to the isocenter or to the detector center. If the isocenter is at the origin and the source is at $(x_s, y_s, z_s)$ on a circle, the direction vector that points from the source to isocenter is
$$
\vec{d} = \frac{-\vec{r}_s}{\lVert \vec{r}_s \rVert}
= \frac{(-x_s, -y_s, -z_s)}{\sqrt{x_s^2 + y_s^2 + z_s^2}}.
$$
For each projection angle, this direction changes together with the source position. In a rotating CT simulation, you typically update the direction vector in the same loop that updates the position, so the beam always points through the isocenter or the center of the detector.

For fan‑beam and cone‑beam geometries, you can still use a single central direction vector, but the source is configured to emit photons in a cone around that central axis. The cone opening angle is determined by the detector size and the source‑to‑detector distance. A narrow cone produces a small field of view, while a wide cone covers a larger area but may increase scatter and dose outside the region of interest.

If you want to simulate a perfectly parallel beam, as is sometimes used for simple attenuation studies or algorithm testing, the direction vector is constant and the source angular spread is restricted so that all photons travel in nearly the same direction. This does not correspond to a realistic point source at finite distance, but it is often useful for validating analytical formulas and basic concepts.

Again, consistency with geometry is crucial. The most frequent problems with X‑ray beam direction are a beam that misses the detector or does not pass through the phantom at all. Visualizing the geometry and particle tracks is an effective way to confirm that your direction vector is correct.

The X‑ray beam direction must be a properly normalized vector aligned with your imaging geometry, typically from source to isocenter or from source to detector center. A wrong direction vector can produce a valid simulation that, however, does not irradiate the intended region.

Energy spectrum

Clinical and experimental X‑ray beams are rarely monoenergetic. Instead, they have a continuous energy spectrum shaped by the tube voltage, anode material, and filtration. In GATE, you can represent this either as a monoenergetic beam, useful for concept tests, or as a realistic polyenergetic spectrum that better matches real CT or radiography systems.

A monoenergetic source assigns the same photon energy to every primary particle, for instance $E = 80 \,\text{keV}$. This is simple to set up and simplifies interpretation, but it does not reproduce the beam hardening and contrast behavior of real X‑ray imaging. For realistic CT, you should specify an energy distribution that covers a range from some low energy cutoff up to the maximum tube potential, such as 120 kVp.

The most flexible way to use a spectrum in GATE is to provide an energy probability distribution. Conceptually, you define a function $p(E)$ that describes the relative probability of emitting a photon with energy $E$. In practice, this is often represented as a set of discrete energy bins with associated probabilities or weights:

Energy bin center $E_i$ (keV)Relative weight $w_i$
300.10
500.25
700.30
900.20
1100.15

GATE uses random sampling to select energies according to these weights, so low energy photons are produced less or more frequently depending on the specified spectrum. You usually normalize the weights so that $\sum_i w_i = 1$, although GATE can often normalize them internally.

For CT simulations, spectra are commonly generated using specialized X‑ray spectrum modeling tools that take into account tube voltage, anode angle, and filtration, and then exported as a text file. You can read this file in Python, store the energies and weights in arrays, and configure the GATE source to sample from that distribution. This ensures that the simulated beam has the correct effective energy and spectral shape.

Using a realistic spectrum matters because attenuation coefficients depend strongly on photon energy. If you use a monoenergetic beam at the same peak energy as a polyenergetic clinical beam, you will not reproduce the correct contrast, CT numbers, or beam hardening artifacts. Conversely, for simple educational or debugging simulations, a monoenergetic beam can be entirely adequate and easier to analyze.

X‑ray imaging beams are polyenergetic, so for realistic CT or radiography simulation you should use an energy spectrum $p(E)$, not a single energy, and sample photon energies according to the specified probability distribution.

Views: 9

Comments

Please login to add a comment.

Don't have an account? Register now!