httomolibgpu.recon.algorithm

httomolibgpu.recon.algorithm#

Module for tomographic reconstruction

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

Perform Congugate Gradient Least Squares (CGLS) using ASTRA toolbox [10] and ToMoBAR [5] 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: float | None = None, filter_freq_cutoff: float | None = 0.35, recon_size: int | None = None, recon_mask_radius: float | None = 0.95, gpu_id: int = 0) <cp.ndarray>[source]#

Perform Filtered Backprojection (FBP) reconstruction using ASTRA toolbox [10] and ToMoBAR [5] wrappers. This is a 3D recon from the CuPy array directly and using a custom built SINC filter for filtration in Fourier space.

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) – Cutoff frequency parameter for the SINC filter, the lower values produce better contrast 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) – The radius of the circular mask that applies to the reconstructed slice in order to crop out some undesirable artifacts. The values outside the given diameter will be set to zero. It is recommended to keep the value in the range [0.7-1.0].

  • gpu_id (int) – 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: float | None = None, recon_size: int | None = None, recon_mask_radius: float | None = 0.95) <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) – The radius of the circular mask that applies to the reconstructed slice in order to crop out some undesirable artifacts. The values outside the given diameter will be set to zero. It is recommended to keep 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: float | None = None, recon_size: int | None = None, iterations: int | None = 300, nonnegativity: bool | None = True, gpu_id: int = 0) <cp.ndarray>[source]#

Perform Simultaneous Iterative Recostruction Technique (SIRT) using ASTRA toolbox [10] and ToMoBAR [5] 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