PET TOF parameters parallelproj.tof

Time-of-flight parameters for TOF projectors. Construct a TOFParameters object (number of TOF bins, bin width and TOF resolution) and assign it to a projector’s tof_parameters attribute to turn a non-TOF projector into a TOF projector; the forward projection then gains a trailing TOF-bin axis. See the 02_pet_sinogram_projections gallery examples for end-to-end usage.

Time-of-flight (TOF) parameter dataclass for PET scanners.

Defines the bin width, Gaussian kernel width, truncation threshold, and centre offset that parameterise the TOF response model used by the projectors in parallelproj.projectors.

parallelproj.tof.C_MM_PER_NS: float = 299.792458

Speed of light in mm per nanosecond.

class parallelproj.tof.TOFParameters(num_tofbins: int, tofbin_width: float, sigma_tof: float, num_sigmas: float = 3.0, tofcenter_offset: float = 0)[source]

Bases: object

TOF kernel parameters for a PET scanner.

All spatial quantities are in mm. To convert a timing quantity \(t\) (in ns) to a spatial displacement along the LOR, use

\[d \;[\text{mm}] = \frac{c}{2} \cdot t \;[\text{ns}]\]

where \(c\) = C_MM_PER_NS mm/ns (= 299.792 mm/ns). The factor of 1/2 arises because both photons travel simultaneously toward the two detectors.

Parameters:
  • num_tofbins (int) – Number of TOF bins covering the full LOR.

  • tofbin_width (float) – Width of each TOF bin in mm.

  • sigma_tof (float) – Standard deviation of the Gaussian TOF kernel in mm.

  • num_sigmas (float, optional) – Number of sigmas at which the Gaussian kernel is truncated. default 3.0.

  • tofcenter_offset (float, optional) – Global shift of the TOF bin grid centre from the LOR midpoint in mm. This is a scalar approximation (identical for all LORs); default 0. A non-zero value is needed when systematic timing offsets are present, e.g. due to unequal cable lengths or electronics delays. The offset is measured along the xstart -> xend direction of each LOR, so if the LOR endpoint convention is reversed (see LOREndpointOrder END_START) a non-zero offset must be negated to keep the same physical meaning.

Raises:

ValueError – If num_tofbins is not a positive integer, if tofbin_width, sigma_tof or num_sigmas is not strictly positive, or if any value is not finite. A common cause is passing timing quantities in seconds/ps instead of the expected spatial mm (see the conversion above).

Example

A scanner with 385 ps FWHM TOF resolution and 13 fine bins of 0.01302 ns each grouped into one sinogram bin:

# sigma_tof: FWHM [ns] / 2.355 * c/2 [mm/ns]
sigma_tof = (385e-3 / 2.355) * (C_MM_PER_NS / 2)   # ~ 24.5 mm

# tofbin_width: 13 fine bins * 0.01302 ns * c/2
tofbin_width = 13 * 0.01302 * (C_MM_PER_NS / 2)    # ~ 25.4 mm

p = TOFParameters(
    num_tofbins=29,
    tofbin_width=tofbin_width,
    sigma_tof=sigma_tof,
    num_sigmas=3.0,
)

Examples

TOF-bin mashing: fewer, wider time-of-flight bins

TOF-bin mashing: fewer, wider time-of-flight bins

PET TOF sinogram projector

PET TOF sinogram projector

Non-TOF and TOF projections using a modularized (block) PET scanner geometry

Non-TOF and TOF projections using a modularized (block) PET scanner geometry

PET listmode projector (non-TOF and TOF)

PET listmode projector (non-TOF and TOF)

Listmode to sinogram unlisting

Listmode to sinogram unlisting

Convergence comparison: MLEM vs OSEM vs SVRG

Convergence comparison: MLEM vs OSEM vs SVRG

Convergence comparison: SGD vs SVRG with logcosh regularization

Convergence comparison: SGD vs SVRG with logcosh regularization

PDHG and SPDHG for PET reconstruction with a directional TV prior

PDHG and SPDHG for PET reconstruction with a directional TV prior

TOF vs non-TOF: variance reduction in a uniform cylinder

TOF vs non-TOF: variance reduction in a uniform cylinder

RAM-efficient OSEM with disk-backed TOF sinograms

RAM-efficient OSEM with disk-backed TOF sinograms

Listmode MLEM, OSEM, and SVRG

Listmode MLEM, OSEM, and SVRG

Convergence comparison: SGD vs SVRG with regularization (sinogram and listmode)

Convergence comparison: SGD vs SVRG with regularization (sinogram and listmode)

PDHG and LM-SPDHG to optimize the Poisson logL and total variation

PDHG and LM-SPDHG to optimize the Poisson logL and total variation

Joint activity and attenuation reconstruction (MLAA) for TOF PET

Joint activity and attenuation reconstruction (MLAA) for TOF PET
num_sigmas: float = 3.0
num_tofbins: int
sigma_tof: float
tofbin_width: float
tofcenter_offset: float = 0
parallelproj.tof.get_tof_parameters_G1(**kwargs) TOFParameters[source]

Demo TOFParameters G1 (matches the G1 scanner).

Defaults to 27 TOF bins with a 385 ps coincidence timing resolution (sigma_tof) and a 169 ps TOF-bin width, converted from ns to mm via x = t * C_MM_PER_NS / 2. Pair it with parallelproj.pet_lors.get_lor_descriptor_G1(). Any TOFParameters field (num_tofbins, tofbin_width, sigma_tof, num_sigmas, tofcenter_offset) can be overridden via keyword.

Examples

Return type:

TOFParameters

parallelproj.tof.get_tof_parameters_G2(**kwargs) TOFParameters[source]

Demo TOFParameters G2 (matches the G2 scanner).

Identical to get_tof_parameters_G1() but with 29 TOF bins by default. Pair it with parallelproj.pet_lors.get_lor_descriptor_G2(). Any TOFParameters field can be overridden via keyword.

Examples

Return type:

TOFParameters