pytomography.transforms.PET.attenuation#

Module Contents#

Classes#

PETAttenuationTransform

proj2proj mapping used to model the effects of attenuation in PET.

Functions#

get_prob_of_detection_matrix(CT, dx)

Converts an attenuation map of \(\text{cm}^{-1}\) to a probability of photon detection projection (detector pair oriented along x axis). Note that this requires the attenuation map to be at the energy of photons being emitted (511keV).

pytomography.transforms.PET.attenuation.get_prob_of_detection_matrix(CT, dx)[source]#

Converts an attenuation map of \(\text{cm}^{-1}\) to a probability of photon detection projection (detector pair oriented along x axis). Note that this requires the attenuation map to be at the energy of photons being emitted (511keV).

Parameters:
  • CT (torch.tensor) – Tensor of size [batch_size, Lx, Ly, Lz] corresponding to the attenuation coefficient in \({\text{cm}^{-1}}\)

  • dx (float) – Axial plane pixel spacing.

Returns:

Tensor of size [batch_size, 1, Ly, Lz] corresponding to probability of photon being detected at a detector pairs oriented along the x axis.

Return type:

torch.tensor

class pytomography.transforms.PET.attenuation.PETAttenuationTransform(CT)[source]#

Bases: pytomography.transforms.Transform

proj2proj mapping used to model the effects of attenuation in PET.

Parameters:
  • CT (torch.tensor) – Tensor of size [batch_size, Lx, Ly, Lz] corresponding to the attenuation coefficient in \({\text{cm}^{-1}}\) at a photon energy of 511keV.

  • device (str, optional) – Pytorch device used for computation. If None, uses the default device pytomography.device Defaults to None.

configure(object_meta, proj_meta)[source]#

Function used to initalize the transform using corresponding object and projection metadata

Parameters:
  • object_meta (ObjectMeta) – Object metadata.

  • proj_meta (ProjMeta) – Projection metadata.

Return type:

None

forward(proj)[source]#

Applies forward projection of attenuation modeling \(B:\mathbb{V} \to \mathbb{V}\) to 2D PET projections.

Parameters:

proj (torch.Tensor) – Tensor of size [batch_size, Ltheta, Lr, Lz] which transform is appplied to

Returns:

Tensor of size [batch_size, Ltheta, Lr, Lz] corresponding to attenuation-corrected projections.

Return type:

torch.Tensor

backward(proj, norm_constant=None)[source]#

Applies back projection of attenuation modeling \(B^T:\mathbb{V} \to \mathbb{V}\) to 2D PET projections. Since the matrix is diagonal, its the backward implementation is identical to the forward implementation; the only difference is the optional norm_constant which is needed if one wants to normalize the back projection.

Parameters:
  • proj (torch.Tensor) – Tensor of size [batch_size, Ltheta, Lr, Lz] which transform is appplied to

  • norm_constant (torch.Tensor | None, optional) – A tensor used to normalize the output during back projection. Defaults to None.

Returns:

Tensor of size [batch_size, Ltheta, Lr, Lz] corresponding to attenuation-corrected projections.

Return type:

torch.tensor