scico.linop.xray.astra#

X-ray transform LinearOperator wrapping the ASTRA toolbox.

X-ray transform LinearOperator wrapping the parallel beam projections in the ASTRA toolbox. This package provides both C and CUDA implementations of core functionality, but note that use of the CUDA/GPU implementation is expected to result in GPU-host-GPU memory copies when transferring JAX arrays. Other JAX features such as automatic differentiation are not available.

Functions

ensure_writeable(x)

Ensure that x.flags.writeable is True, copying if needed.

Classes

XRayTransform(input_shape, detector_spacing, ...)

Parallel beam X-ray transform based on the ASTRA toolbox.

class scico.linop.xray.astra.XRayTransform(input_shape, detector_spacing, det_count, angles, volume_geometry=None, device='auto')[source]#

Bases: LinearOperator

Parallel beam X-ray transform based on the ASTRA toolbox.

Inheritance diagram of XRayTransform

Perform tomographic projection (also called X-ray projection) of an image or volume at specified angles, using the ASTRA toolbox.

Parameters:
  • input_shape (Tuple[int, ...]) – Shape of the input array. Determines whether 2D or 3D algorithm is used.

  • detector_spacing (Union[float, Tuple[float, float]]) – Spacing between detector elements. See the astra documentation for more information for 2d or 3d geometries.

  • det_count (Union[int, Tuple[int, int]]) – Number of detector elements. See the astra documentation for more information for 2d or 3d geometries.

  • angles (ndarray) – Array of projection angles in radians.

  • volume_geometry (Optional[List[float]]) – Specification of the shape of the discretized reconstruction volume. Must either None, in which case it is inferred from input_shape, or follow the astra syntax described in the astra documentation for 2d or 3d geometries.

  • device (str) – Specifies device for projection operation. One of [“auto”, “gpu”, “cpu”]. If “auto”, a GPU is used if available, otherwise, the CPU is used.

fbp(sino, filter_type='Ram-Lak')[source]#

Filtered back projection (FBP) reconstruction.

Perform tomographic reconstruction using the filtered back projection (FBP) algorithm.

Parameters:
  • sino (Array) – Sinogram to reconstruct.

  • filter_type (str) – Select the filter to use. For a list of options see cfg.FilterType in the ASTRA documentation.

Return type:

Array

scico.linop.xray.astra.ensure_writeable(x)[source]#

Ensure that x.flags.writeable is True, copying if needed.