XrayTransform#

class deepinv.physics.functional.XrayTransform(projection_geometry, object_geometry, is_2d=False)[source]#

Bases: object

X-ray Transform operator with astra-toolbox backend.

Uses the astra-toolbox to implement a ray-driven forward projector and a pixel-driven backprojector (XrayTransform.T). This class leverages the GPULink functionality of astra to share the underlying CUDA memory between torch Tensors and CUDA-based arrays use in astra. The functionality is only implemented for 3D arrays, thus the underlying transforms are all 3D operators. For 2D transforms, the object is set to a flat volume with only 1 voxel depth.

Note

This transform does not handle batched and multi-channel inputs. It is handled by a custom torch.autograd.Function that wraps the XrayTransform. To handle standard PyTorch pipelines, XrayTransform is instanciated inside a deepinv.physics.TomographyWithAstra operator.

Parameters:
  • projection_geometry (dict[str, Any]) – Dictionnary containing the parameters of the projection geometry. It is passed to the astra.create_projector() function to instanciate the projector.

  • object_geometry (dict[str, Any]) – Dictionnary containing the parameters of the object geometry. It is passed to the astra.create_projector() function to instanciate the projector.

  • is_2d (bool) – Specifies if the geometry is flat (2D) or describe a real 3D reconstruction setup.

property T#

Implements and returns the adjoint of the transform operator.

property detector_cell_area: float#

The surface in physical units of a detector pixel.

property detector_cell_u_length: float#

The horizontal length of a detector cell.

property detector_cell_v_length: float#

The vertical length of a detector cell.

property detector_radius: float#

The distance between the center of the detector and the axis of rotation.

property domain_shape: tuple#

The shape of the input volume.

property magnitude: float#

The magnification factor induced by the fan/cone geometry.

property object_cell_volume: float#

The volume in physical units of a voxel.

property range_shape: tuple#

The shape of the output projection.

property source_radius: float#

The distance between the source and the axis of rotation.