pytomography.transforms.PET
#
Submodules#
Package Contents#
Classes#
proj2proj mapping used to model the effects of attenuation in PET. |
|
proj2proj transform used to model the effects of PSF blurring in PET. The smoothing kernel is assumed to be independent of \(\theta\) and \(z\), but is dependent on \(r\). |
- class pytomography.transforms.PET.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 theforward
implementation; the only difference is the optionalnorm_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
- class pytomography.transforms.PET.PETPSFTransform(kerns)[source]#
Bases:
pytomography.transforms.Transform
proj2proj transform used to model the effects of PSF blurring in PET. The smoothing kernel is assumed to be independent of \(\theta\) and \(z\), but is dependent on \(r\).
- Parameters:
kerns (Sequence[callable]) – A sequence of PSF kernels applied to the Lr dimension of the projections with shape [batch_size, Lr, Ltheta, Lz]
- configure(object_meta, proj_meta)[source]#
Function used to initalize the transform using corresponding object and proj metadata
- Parameters:
object_meta (ObjectMeta) – Object metadata.
proj_meta (ProjMeta) – Projection metadata.
- Return type:
None
- forward(proj)[source]#
Applies the forward projection of PSF modeling \(B:\mathbb{V} \to \mathbb{V}\) to a PET proj.
- Parameters:
proj (torch.tensor]) – Tensor of size [batch_size, Ltheta, Lr, Lz] corresponding to the projections
- Returns:
Tensor of size [batch_size, Ltheta, Lr, Lz] corresponding to the PSF corrected projections.
- Return type:
torch.tensor
- backward(proj, norm_constant=None)[source]#
Applies the back projection of PSF modeling \(B^T:\mathbb{V} \to \mathbb{V}\) to PET projections .
- Parameters:
proj (torch.tensor]) – Tensor of size [batch_size, Ltheta, Lr, Lz] corresponding to the projections norm_constant (torch.tensor, optional): A tensor used to normalize the output during back projection. Defaults to None.
norm_constant (torch.Tensor | None) –
- Returns:
Tensor of size [batch_size, Ltheta, Lr, Lz] corresponding to the PSF corrected projections.
- Return type:
torch.tensor