Radon

class deepinv.physics.functional.Radon(in_size=None, theta=None, circle=False, parallel_computation=True, fan_beam=False, fan_parameters=None, dtype=torch.float32, device=device(type='cpu'))[source]

Bases: Module

Sparse Radon transform operator.

Parameters:
  • in_size (int) – the size of the input image. If None, the size is inferred from the input image.

  • theta (torch.Tensor) – the angles at which the Radon transform is computed. Default is torch.arange(180).

  • circle (bool) – if True, the input image is assumed to be a circle. Default is False.

  • parallel_computation (bool) – if True, all projections are performed in parallel. Requires more memory but is faster on GPUs.

  • fan_beam (bool) – If True, use fan beam geometry, if False use parallel beam

  • fan_parameters (dict) –

    Only used if fan_beam is True. Contains the parameters defining the scanning geometry. The dict should contain the keys:

    • ”pixel_spacing” defining the distance between two pixels in the image, default: 0.5 / (in_size)

    • ”source_radius” distance between the x-ray source and the rotation axis (middle of the image), default: 57.5

    • ”detector_radius” distance between the x-ray detector and the rotation axis (middle of the image), default: 57.5

    • ”n_detector_pixels” number of pixels of the detector, default: 258

    • ”detector_spacing” distance between two pixels on the detector, default: 0.077

    The default values are adapted from the geometry in https://doi.org/10.5281/zenodo.8307932, where pixel spacing, source and detector radius and detector spacing are given in cm. Note that a to small value of n_detector_pixels*detector_spacing can lead to severe circular artifacts in any reconstruction.

  • dtype (torch.dtype) – the data type of the output. Default is torch.float.

  • device (str, torch.device) – the device of the output. Default is torch.device(‘cpu’).

forward(x)[source]

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.