pytomography.transforms.SPECT.cutoff — PyTomography 0.8.0 documentation

Skip to main content
`Ctrl`+`K`

# `pytomography.transforms.SPECT.cutoff`

## Module Contents

### Classes

`CutOffTransform` | im2im transformation used to set pixel values equal to zero at the first and last few z slices. This is often required when reconstructing DICOM data due to the finite field of view of the projection data, where additional axial slices are included on the top and bottom, with zero measured detection events. This transform is included in the system matrix, to model the sharp cutoff at the finite FOV.

class pytomography.transforms.SPECT.cutoff.CutOffTransform(image)

  Bases: `pytomography.transforms.Transform`

  im2im transformation used to set pixel values equal to zero at the first and last few z slices. This is often required when reconstructing DICOM data due to the finite field of view of the projection data, where additional axial slices are included on the top and bottom, with zero measured detection events. This transform is included in the system matrix, to model the sharp cutoff at the finite FOV.

  Parameters:

    image (torch.tensor) – Measured image data.

  forward(image)

    Forward projection \(B:\mathbb{V} \to \mathbb{V}\) of the cutoff transform.

    Parameters:

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

    Returns:

      Original image, but with certain z-slices equal to zero.

    Return type:

      torch.tensor

  backward(image, norm_constant=None)

    Back projection \(B^T:\mathbb{V} \to \mathbb{V}\) of the cutoff transform. Since this is a diagonal matrix, the implementation is the same as forward projection, but with the optional norm_constant argument.

    Parameters:

      - image (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:

      Original image, but with certain z-slices equal to zero.

    Return type:

      torch.tensor