pytomography.metadata.PET#
Submodules#
Package Contents#
Classes#
Metadata required for PET listmode modeling. PET listmode projection actually requires two different projectors: the system matrix that projects to all detected crystal pair LORs (which is denoted as \(H\)) and the system matrix that projects to all valid LORs (denoted as \(\tilde{H}\)). The system matrix \(H\) is used for forward/back projection in reconstruction algorithms, while \(\tilde{H}\) is used for computing the normalization image \(\tilde{H}^T 1\). |
|
Class for PET time of flight metadata. Contains information such as spatial binning and resolution. |
|
PET Sinogram metadata class for polygonal scanner geometry |
- class pytomography.metadata.PET.PETLMProjMeta(detector_ids, info=None, scanner_LUT=None, tof_meta=None, weights=None, detector_ids_sensitivity=None, weights_sensitivity=None)[source]#
Metadata required for PET listmode modeling. PET listmode projection actually requires two different projectors: the system matrix that projects to all detected crystal pair LORs (which is denoted as \(H\)) and the system matrix that projects to all valid LORs (denoted as \(\tilde{H}\)). The system matrix \(H\) is used for forward/back projection in reconstruction algorithms, while \(\tilde{H}\) is used for computing the normalization image \(\tilde{H}^T 1\). :param detector_ids: \(N \times 2\) (non-TOF) or \(N \times 3\) (TOF) tensor that provides detector ID pairs (and TOF bin) for coincidence events. This information is used to construct \(H\). :type detector_ids: torch.Tensor :param info: Dictionary containing all relevant information about the scanner. If
scanner_LUTis not provided, then info is used to create thescanner_LUT. At least one ofinfoorscanner_LUTshould be provided as input arguments. :type info: dict, optional :param scanner_LUT: scanner lookup table that provides spatial coordinates for all detector ID pairs. Ifinfois not provided, thenscanner_LUTmust be provided. :type scanner_LUT: torch.Tensor, optional :param tof_meta: PET time-of-flight metadata used to modify \(H\) for time of flight projection. If None, then time of flight is not used. Defaults to None. :type tof_meta: PETTOFMeta | None, optional :param weights: weights used to scale projections after forward projection and before back projection; these modify the system matrix \(H\). While such weights can be used to apply attenuation/normalization correction, they aren’t required in the absence of randoms/scatter; these correction need only be performed usingweights_sensitivity. If provided, these weights must have the number of elements as the first dimension ofdetector_ids. If none, then no scaling is done. Defaults to None. :type weights: torch.tensor | None, optional :param detector_ids_sensitivity: valid detector ids used to generate the sensitivity image \(\tilde{H}^T 1\). As such, these are used to construct \(\tilde{H}\). If None, then assumes all detector ids (specified byscanner_LUT) are valid. Defaults to None. :type detector_ids_sensitivity: torch.tensor | None, optional :param weights_sensitivity: weights used for scaling projections in the computation of the sensitivity image, if the weights are given as \(w\) then the sensitivty image becomes \(\tilde{H}^T w\); these modify the system matrix \(\tilde{H}\). These weights are used for attenuation/normalization correction. Ifdetector_ids_sensitivityis provided, thenweights_sensitivityshould have the same shape. Ifdetector_ids_sensitivityis not provided, thenweights_sensitivityshould be the same length as all possible combinations of detectors in thescanner_LUT. If None, then no scaling is performed. Defaults to None. :type weights_sensitivity: torch.tensor | None, optional- Parameters:
detector_ids (torch.Tensor) –
info (dict | None) –
scanner_LUT (torch.Tensor | None) –
tof_meta (pytomography.metadata.PET.pet_tof_metadata.PETTOFMeta | None) –
weights (torch.tensor | None) –
detector_ids_sensitivity (torch.Tensor | None) –
weights_sensitivity (torch.tensor | None) –
- class pytomography.metadata.PET.PETTOFMeta(num_bins, tof_range, fwhm, n_sigmas=3, bin_type='symmetric')[source]#
Class for PET time of flight metadata. Contains information such as spatial binning and resolution.
- Parameters:
num_bins (int) – Number of bins used to discretize time of flight data
tof_range (float) – Total range accross all TOF bins in mm.
fwhm (float) – FWHM corresponding to TOF uncertainty in mm.
n_sigmas (float) – Number of sigmas to consider when using TOF projection. Defaults to 3.
bin_type (str, optional) – How the bins are arranged. Currently, the only option is symmetry, which means the bins are distributed symmetrically (evenly on each side) between the center of all LOR pairs. Defaults to ‘symmetric’.
- class pytomography.metadata.PET.PETSinogramPolygonProjMeta(info, tof_meta=None)[source]#
PET Sinogram metadata class for polygonal scanner geometry
- Parameters:
info (dict) – PET geometry information dictionary
tof_meta (PETTOFMeta | None, optional) – PET time of flight metadata. If None, then assumes no time of flight. Defaults to None.