calculate_frame_reference_time#

petpal.utils.scan_timing.calculate_frame_reference_time(frame_duration: numpy.ndarray, frame_start: numpy.ndarray, half_life: float) numpy.ndarray#

Compute frame reference time as the time at which the average activity occurs.

Equation comes from the DICOM standard documentation

\(T_{ave}=\frac{1}{\lambda}ln\frac{\lambda T}{1-e^{-\lambda T}}\)

where lambda is the decay constant, \(\frac{ln2}{T_{1/2}}\), \(T_{1/2}\) is the half life, and \(T\) is the frame duration.

Parameters:
  • frame_duration (np.ndarray) – Duration of each frame in seconds.

  • frame_start (np.ndarray) – Start time of each frame relative to scan start, in seconds.

  • half_life (float) – Radionuclide half life in seconds.

Returns:

np.ndarray – Frame reference time for each frame in the scan in seconds.