KAHIBARO
Discord Login Register

22.4. Timing Analysis

Time differences

Timing analysis in GATE-based PET or SPECT simulations focuses on how detection times differ between events or between detector elements. With Python you usually start from ROOT files produced by GATE, read them with Uproot or a similar library, and then compute time differences numerically.

In coincidence PET you typically have singles data with at least a time stamp, detector IDs, and possibly a coincidence tag or event index. When GATE already outputs coincidence data, each coincidence entry usually contains two detection times, one for each detector in the pair. The fundamental timing quantity is the difference
$$
\Delta t = t_2 - t_1,
$$
where $t_1$ and $t_2$ are the detection times of the two photons in a coincidence. In a time-of-flight PET context $\Delta t$ is later converted into a position along the line of response, but at the level of timing analysis you first treat it purely as a time difference.

When you read coincidence data into Python, you typically obtain two arrays, for example t1 and t2 in nanoseconds. You then form the time difference with vectorized operations such as delta_t = t2 - t1. If the detector ordering is arbitrary, you may choose a convention to keep $\Delta t$ centered around zero, for example by sorting the times per event before subtraction or simply accepting that a symmetric distribution will appear centered at zero if the two detectors are equivalent.

It is important that you always work in consistent units. GATE times are usually stored in seconds in the ROOT output. If your analysis assumes nanoseconds you must convert using
$$
t_{\text{ns}} = t_{\text{s}} \times 10^9.
$$

Always verify and convert time units consistently between GATE output and Python analysis. A missing factor of $10^3$ or $10^9$ will produce timing resolutions and coincidence windows that are completely unphysical.

For basic timing quality checks you often need only simple statistics on $\Delta t$: mean, standard deviation, and possibly higher-order moments. The mean shows any systematic offset in your timing, for example a delay in one detector, while the standard deviation is related to the coincidence timing resolution of the system. In a simple Gaussian approximation the coincidence timing resolution is often quoted as the full width at half maximum of the distribution:
$$
\text{FWHM} = 2.355 \,\sigma,
$$
where $\sigma$ is the standard deviation of $\Delta t$.

In Python you compute these with standard array operations. You may also restrict your analysis to a subset of events, for instance only those with energies inside the PET photopeak, to see how timing performance depends on energy. This is common in TOF PET where timing resolution often improves for higher deposited energies.

Coincidence distributions

Once you have time differences, the central timing analysis tool is the coincidence time difference histogram, also called the timing spectrum. You create a histogram of $\Delta t$ values over a range that covers and exceeds your coincidence window, for example from $-10$ ns to $+10$ ns for a system with subnanosecond resolution. In Python you typically use functions like numpy.histogram or matplotlib.pyplot.hist to construct and display this distribution.

A well configured coincidence system produces a timing distribution with a sharp central peak around zero. The shape and width of this peak reflect the combined timing response of the two detectors involved and any additional time blurring specified in your GATE digitizer. If your simulation includes time blurring with a given Gaussian sigma, the measured timing spectrum should match that configuration within statistical uncertainty.

You can summarize coincidence timing performance in a table of key quantities extracted from the distribution:

QuantityHow it is obtainedInterpretation
Mean of $\Delta t$Fit or compute average of the histogramSystematic timing offset between detectors
Standard deviation $\sigma$Fit Gaussian or compute from dataStatistical timing spread
FWHM$2.355 \sigma$ or direct measurement from histogramCoincidence timing resolution
Coincidence window fractionIntegral inside chosen window divided by total coincidencesEfficiency of a given coincidence time window

To estimate these quantities you can either fit a Gaussian function to the central part of the histogram or compute them directly from the raw $\Delta t$ values. For large data sets and a nearly Gaussian response, both approaches give similar results. Fitting can be beneficial when you want to ignore long non-Gaussian tails produced by scattered or random coincidences.

The coincidence time window used in your simulation, for example $\pm 2$ ns, can also be evaluated using the measured distribution. By integrating the histogram inside and outside the window you can estimate what fraction of valid coincidences is kept or rejected. This is especially useful in TOF PET where you might explore how changing the window width affects sensitivity and random coincidence rejection.

In Python analysis it is also common to examine timing distributions separately for different detector pairs or detector regions. You can group coincidences by detector IDs, then compute and plot $\Delta t$ distributions for each group. This reveals nonuniformities in timing performance, such as particular modules with poorer resolution or systematic timing offsets.

For coincidence timing analysis:

  1. Always compute and inspect the $\Delta t$ histogram for quality control.
  2. Use the standard deviation $\sigma$ or FWHM of the central peak as your main timing resolution metric.
  3. Evaluate how your chosen coincidence time window affects the fraction of accepted coincidences, and ensure it is consistent with both your GATE digitizer settings and the observed timing spectrum.

Beyond a single global histogram, you may also study timing as a function of other variables, such as energy or detector position. For example, you can bin events in energy, then compute the FWHM of the $\Delta t$ distribution in each energy bin, and plot timing resolution versus energy. Similar analyses can be done for different positions across the detector field of view. All of these rely on the same core steps: compute time differences from coincidence data, build coincidence distributions in Python, and extract timing metrics from those distributions.

Views: 10

Comments

Please login to add a comment.

Don't have an account? Register now!