scico.linop.xray.astra

X-ray transform LinearOperators 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

angle_to_vector(det_spacing, angles)

Convert det_spacing and angles to vector geometry specification.

set_astra_gpu_index(idx)

Set the index/indices of GPU(s) to be used by astra.

Classes

XRayTransform2D(input_shape, det_count, ...)

2D parallel beam X-ray transform based on the ASTRA toolbox.

XRayTransform3D(input_shape, det_count[, ...])

3D parallel beam X-ray transform based on the ASTRA toolbox.

scico.linop.xray.astra.set_astra_gpu_index(idx)[source]

Set the index/indices of GPU(s) to be used by astra.

Parameters:

idx (Union[int, Sequence[int]]) – Index or indices of GPU(s).

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

Bases: LinearOperator

2D parallel beam X-ray transform based on the ASTRA toolbox.

Inheritance diagram of XRayTransform2D

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

Parameters:
  • input_shape (Tuple[int, ...]) – Shape of the input array.

  • det_spacing (float) – Spacing between detector elements. See the astra documentation for more information..

  • det_count (int) – Number of detector elements. See the astra documentation for more information.

  • 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 syntax described in the astra documentation.

  • 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

class scico.linop.xray.astra.XRayTransform3D(input_shape, det_count, det_spacing=None, angles=None, vectors=None)[source]

Bases: LinearOperator

3D parallel beam X-ray transform based on the ASTRA toolbox.

Inheritance diagram of XRayTransform3D

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

This class supports both “parallel3d” and “parallel3d_vec” astra projection geometries. Keyword arguments det_spacing and angles should be specified to use the former, and keyword argument vectors should be specified to use the latter. These options are mutually exclusive.

Parameters:
scico.linop.xray.astra.angle_to_vector(det_spacing, angles)[source]

Convert det_spacing and angles to vector geometry specification.

Parameters:
Return type:

ndarray

Returns:

Array of geometry specification vectors.