pytomography.transforms.SPECT.atteunation — PyTomography 0.8.0 documentation

Skip to main content
`Ctrl`+`K`

# `pytomography.transforms.SPECT.atteunation`

## Module Contents

### Classes

`SPECTAttenuationTransform` | obj2obj transform 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.transforms.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.transforms.SPECT.atteunation.SPECTAttenuationTransform(CT)

  Bases: `pytomography.transforms.Transform`

  obj2obj transform 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

  forward(object_i, ang_idx)

    Forward projection \(A:\mathbb{U} \to \mathbb{U}\) of attenuation correction

    Parameters:

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

      - ang_idx (torch.Tensor) – The projection indices: used to find the corresponding angle in image space corresponding to each projection angle in `object_i`.

    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

  backward(object_i, ang_idx, norm_constant=None)

    Back projection \(A^T:\mathbb{U} \to \mathbb{U}\) of attenuation correction. Since the matrix is diagonal, the implementation is the same as forward projection. The only difference is the optional normalization parameter.

    Parameters:

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

      - ang_idx (torch.Tensor) – The projection indices: used to find the corresponding angle in image space corresponding to each projection angle in `object_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