pytomography.mappings.SPECT.atteunation#

Module Contents#

Classes#

SPECTAttenuationNet

obj2obj mapping used to model the effects of attenuation in SPECT.

Functions#

get_prob_of_detection_matrix(CT, dx)

Converts an attenuation map of \(\text{cm}^{-1}\) to a probability of photon detection matrix (scanner at +x). Note that this requires the attenuation map to be at the energy of photons being emitted.

pytomography.mappings.SPECT.atteunation.get_prob_of_detection_matrix(CT, dx)#

Converts an attenuation map of \(\text{cm}^{-1}\) to a probability of photon detection matrix (scanner at +x). Note that this requires the attenuation map to be at the energy of photons being emitted.

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

  • dx (float) – Axial plane pixel spacing.

Returns:

Tensor of size [batch_size, Lx, Ly, Lz] corresponding to probability of photon being detected at detector at +x axis.

Return type:

torch.tensor

class pytomography.mappings.SPECT.atteunation.SPECTAttenuationNet(CT, device='cpu')#

Bases: pytomography.mappings.MapNet

obj2obj mapping used to model the effects of attenuation in SPECT.

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

  • device (str, optional) – Pytorch computation device. Defaults to ‘cpu’.

forward(object_i, i, norm_constant=None)#

Applies attenuation modeling to an object that’s being detected on the right of its first axis.

Parameters:
  • object_i (torch.tensor) – Tensor of size [batch_size, Lx, Ly, Lz] being projected along axis=1.

  • i (int) – The projection index: used to find the corresponding angle in image space corresponding to object_i. In particular, the x axis (tensor axis=1) of the object is aligned with the detector at angle i.

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

Returns:

Tensor of size [batch_size, Lx, Ly, Lz] such that projection of this tensor along the first axis corresponds to an attenuation corrected projection.

Return type:

torch.tensor