pytomography.transforms.shared.spatial#

Module Contents#

Classes#

RotationTransform

obj2obj transform used to rotate an object to angle \(\beta\) in the DICOM reference frame. (Note that an angle of )

class pytomography.transforms.shared.spatial.RotationTransform(mode='bilinear')[source]#

Bases: pytomography.transforms.Transform

obj2obj transform used to rotate an object to angle \(\beta\) in the DICOM reference frame. (Note that an angle of )

Parameters:

mode (str) – Interpolation mode used in the rotation.

forward(object, angles)[source]#

Rotates an object to angle \(\beta\) in the DICOM reference frame. Note that the scanner angle \(\beta\) is related to \(\phi\) (azimuthal angle) by \(\phi = 3\pi/2 - \beta\).

Parameters:
  • object (torch.tensor) – Tensor of size [batch_size, Lx, Ly, Lz] being rotated.

  • angles (torch.Tensor) – Tensor of size [batch_size] corresponding to the rotation angles.

Returns:

Tensor of size [batch_size, Lx, Ly, Lz] where each element in the batch dimension is rotated by the corresponding angle.

Return type:

torch.tensor

backward(object, angles)[source]#

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

Parameters:
  • object (torch.tensor) – Tensor of size [batch_size, Lx, Ly, Lz] being rotated.

  • angles (torch.Tensor) – Tensor of size [batch_size] corresponding to the rotation angles.

Returns:

Tensor of size [batch_size, Lx, Ly, Lz] where each element in the batch dimension is rotated by the corresponding angle.

Return type:

torch.tensor