httomolibgpu.recon.algorithm#

Module for tomographic reconstruction

httomolibgpu.recon.algorithm.CGLS(data: <cp.ndarray>, angles: <cp.ndarray>, center: typing.Optional[float] = None, recon_size: typing.Optional[int] = None, iterations: typing.Optional[int] = 20, nonnegativity: typing.Optional[bool] = True, gpu_id: int = 0) <cp.ndarray>[source]#

Perform Congugate Gradient Least Squares (CGLS) using ASTRA toolbox [7] and ToMoBAR [3] wrappers. This is 3D recon directly from a CuPy array while using ASTRA GPUlink capability.

Parameters
  • data (cp.ndarray) – Projection data as a CuPy array.

  • angles (np.ndarray) – An array of angles given in radians.

  • center (float, optional) – The center of rotation (CoR).

  • recon_size (int, optional) – The [recon_size, recon_size] shape of the reconstructed slice in pixels. By default (None), the reconstructed size will be the dimension of the horizontal detector.

  • iterations (int, optional) – The number of CGLS iterations.

  • nonnegativity (bool, optional) – Impose nonnegativity constraint on reconstructed image.

  • gpu_id (int, optional) – A GPU device index to perform operation on.

Returns

The CGLS reconstructed volume as a CuPy array.

Return type

cp.ndarray

httomolibgpu.recon.algorithm.FBP(data: <cp.ndarray>, angles: <cp.ndarray>, center: typing.Optional[float] = None, filter_freq_cutoff: typing.Optional[float] = 1.1, recon_size: typing.Optional[int] = None, recon_mask_radius: typing.Optional[float] = None, gpu_id: int = 0) <cp.ndarray>[source]#

Perform Filtered Backprojection (FBP) reconstruction using ASTRA toolbox [7] and ToMoBAR [3] wrappers. This is a 3D recon from a CuPy array directly and a custom built filter.

Parameters
  • data (cp.ndarray) – Projection data as a CuPy array.

  • angles (np.ndarray) – An array of angles given in radians.

  • center (float, optional) – The center of rotation (CoR).

  • filter_freq_cutoff (float, optional) – Cutoff frequency parameter for the sinc filter, the lowest values produce more crispy but noisy reconstruction.

  • recon_size (int, optional) – The [recon_size, recon_size] shape of the reconstructed slice in pixels. By default (None), the reconstructed size will be the dimension of the horizontal detector.

  • recon_mask_radius (float, optional) – The radius of the circular mask that applies to the reconstructed slice in order to crop out some undesirable artifacts. The values outside the diameter will be set to zero. None by default, to see the effect of the mask try setting the value in the range [0.7-1.0].

  • gpu_id (int, optional) – A GPU device index to perform operation on.

Returns

The FBP reconstructed volume as a CuPy array.

Return type

cp.ndarray

httomolibgpu.recon.algorithm.LPRec(data: <cp.ndarray>, angles: <cp.ndarray>, center: typing.Optional[float] = None, recon_size: typing.Optional[int] = None, recon_mask_radius: typing.Optional[float] = None) <cp.ndarray>[source]#

Fourier direct inversion in 3D on unequally spaced (also called as Log-Polar) grids using CuPy array as an input. This implementation follows V. Nikitin’s CUDA-C implementation and TomoCuPy package. [1].

Parameters
  • data (cp.ndarray) – Projection data as a CuPy array.

  • angles (np.ndarray) – An array of angles given in radians.

  • center (float, optional) – The center of rotation (CoR).

  • recon_size (int, optional) – The [recon_size, recon_size] shape of the reconstructed slice in pixels. By default (None), the reconstructed size will be the dimension of the horizontal detector.

  • recon_mask_radius (float, optional) – The radius of the circular mask that applies to the reconstructed slice in order to crop out some undesirable artifacts. The values outside the diameter will be set to zero. None by default, to see the effect of the mask try setting the value in the range [0.7-1.0].

Returns

The Log-polar Fourier reconstructed volume as a CuPy array.

Return type

cp.ndarray

httomolibgpu.recon.algorithm.SIRT(data: <cp.ndarray>, angles: <cp.ndarray>, center: typing.Optional[float] = None, recon_size: typing.Optional[int] = None, iterations: typing.Optional[int] = 300, nonnegativity: typing.Optional[bool] = True, gpu_id: int = 0) <cp.ndarray>[source]#

Perform Simultaneous Iterative Recostruction Technique (SIRT) using ASTRA toolbox [7] and ToMoBAR [3] wrappers. This is 3D recon directly from a CuPy array while using ASTRA GPUlink capability.

Parameters
  • data (cp.ndarray) – Projection data as a CuPy array.

  • angles (np.ndarray) – An array of angles given in radians.

  • center (float, optional) – The center of rotation (CoR).

  • recon_size (int, optional) – The [recon_size, recon_size] shape of the reconstructed slice in pixels. By default (None), the reconstructed size will be the dimension of the horizontal detector.

  • iterations (int, optional) – The number of SIRT iterations.

  • nonnegativity (bool, optional) – Impose nonnegativity constraint on reconstructed image.

  • gpu_id (int, optional) – A GPU device index to perform operation on.

Returns

The SIRT reconstructed volume as a CuPy array.

Return type

cp.ndarray