httomolibgpu.recon.algorithm#
Module for tomographic reconstruction. For more detailed information, see Image reconstruction methods
- httomolibgpu.recon.algorithm.CGLS3d_tomobar(data: <cp.ndarray>, angles: <cp.ndarray>, center: float | None = None, detector_pad: bool | int = False, recon_size: int | None = None, recon_mask_radius: float = 0.95, iterations: int = 20, nonnegativity: bool = True, gpu_id: int = 0) <cp.ndarray>[source]#
Perform Conjugate Gradient Least Squares (CGLS) using ASTRA toolbox [13] and ToMoBAR [6] wrappers. This is 3D recon directly from a CuPy array while using ASTRA GPUlink capability to avoid host-device transactions for projection and backprojection.
- 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).
detector_pad (bool, int) – Detector width padding with edge values to remove circle/arc type artifacts in the reconstruction. Set to True to perform an automated padding or specify a certain value as an integer.
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. To implement the cropping one can use the range [0.7-1.0] or set to 2.0 when no cropping required.
iterations (int) – The number of CGLS iterations.
nonnegativity (bool) – 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.FBP2d_astra(data: <cp.ndarray>, angles: <cp.ndarray>, center: float | None = None, detector_pad: bool | int = False, filter_type: str = 'ram-lak', filter_parameter: float | None = None, filter_d: float | None = None, recon_size: int | None = None, recon_mask_radius: float = 0.95, gpu_id: int = 0) <cp.ndarray>[source]#
Perform Filtered Backprojection (FBP) reconstruction slice-by-slice (2d) using ASTRA toolbox [13] and ToMoBAR [6] wrappers. This is a 2D recon using ASTRA’s API for the FBP_CUDA method, see more in FBP2D (ASTRA-Toolbox).
- Parameters:
data (np.ndarray) – Projection data as a 3d numpy array.
angles (np.ndarray) – An array of angles given in radians.
center (float, optional) – The center of rotation (CoR).
detector_pad (bool, int) – Detector width padding with edge values to remove circle/arc type artifacts in the reconstruction. Set to True to perform an automated padding or specify a certain value as an integer.
filter_type (str) – Type of projection filter, see ASTRA’s API for all available options for filters.
filter_parameter (float, optional) – Parameter value for the ‘tukey’, ‘gaussian’, ‘blackman’ and ‘kaiser’ filter types.
filter_d (float, optional) – D parameter value for ‘shepp-logan’, ‘cosine’, ‘hamming’ and ‘hann’ filter types.
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. To implement the cropping one can use the range [0.7-1.0] or set to 2.0 when no cropping required.
gpu_id (int) – A GPU device index to perform operation on.
- Returns:
The FBP reconstructed volume as a numpy array.
- Return type:
np.ndarray
- httomolibgpu.recon.algorithm.FBP3d_tomobar(data: <cp.ndarray>, angles: <cp.ndarray>, center: float | None = None, detector_pad: bool | int = False, filter_freq_cutoff: float = 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 [13] and ToMoBAR [6] wrappers. This is a 3D recon from the CuPy array directly and using a custom built SINC filter for filtration in Fourier space, see more in FBP3D (ToMoBAR).
- Parameters:
data (cp.ndarray) – Projection data as a 3d CuPy array.
angles (np.ndarray) – An array of angles given in radians.
center (float, optional) – The center of rotation (CoR).
detector_pad (bool, int) – Detector width padding with edge values to remove circle/arc type artifacts in the reconstruction. Set to True to perform an automated padding or specify a certain value as an integer.
filter_freq_cutoff (float) – Cutoff frequency parameter for the SINC filter, the lower values may produce better contrast but noisy reconstruction. The filter change will also affect the dynamic range of the reconstructed image.
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 given diameter will be set to zero. To implement the cropping one can use the range [0.7-1.0] or set to 2.0 when no cropping required.
gpu_id (int) – A GPU device index to perform operation on.
- Returns:
FBP reconstructed volume as a CuPy array.
- Return type:
cp.ndarray
- httomolibgpu.recon.algorithm.FISTA3d_tomobar(data: <cp.ndarray>, angles: <cp.ndarray>, center: float | None = None, detector_pad: bool | int = False, recon_size: int | None = None, recon_mask_radius: float = 0.95, iterations: int = 20, subsets_number: int = 6, regularisation_type: str = 'PD_TV', regularisation_parameter: float = 1e-06, regularisation_iterations: int = 50, regularisation_half_precision: bool = True, nonnegativity: bool = True, gpu_id: int = 0) <cp.ndarray>[source]#
A Fast Iterative Shrinkage-Thresholding Algorithm [2] with various types of regularisation or denoising operations [5] (currently accepts ROF_TV and PD_TV regularisations only).
- 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).
detector_pad (bool, int) – Detector width padding with edge values to remove circle/arc type artifacts in the reconstruction. Set to True to perform an automated padding or specify a certain value as an integer.
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. To implement the cropping one can use the range [0.7-1.0] or set to 2.0 when no cropping required.
iterations (int) – The number of FISTA algorithm iterations.
subsets_number (int) – The number of the ordered subsets to accelerate convergence. Keep the value bellow 10 to avoid divergence.
regularisation_type (str) – A method to use for regularisation. Currently PD_TV and ROF_TV are available.
regularisation_parameter (float) – The main regularisation parameter to control the amount of smoothing/noise removal. Larger values lead to stronger smoothing.
regularisation_iterations (int) – The number of iterations for regularisers (aka INNER iterations).
regularisation_half_precision (bool) – Perform faster regularisation computation in half-precision with a very minimal sacrifice in quality.
nonnegativity (bool) – Impose nonnegativity constraint on the reconstructed image.
gpu_id (int) – A GPU device index to perform operation on.
- Returns:
The FISTA reconstructed volume as a CuPy array.
- Return type:
cp.ndarray
- httomolibgpu.recon.algorithm.LPRec3d_tomobar(data: <cp.ndarray>, angles: <cp.ndarray>, center: float | None = None, detector_pad: bool | int = False, filter_type: str = 'shepp', filter_freq_cutoff: float = 1.0, recon_size: int | None = None, recon_mask_radius: float = 0.95, power_of_2_oversampling: bool | None = True, power_of_2_cropping: bool | None = False, min_mem_usage_filter: bool | None = True, min_mem_usage_ifft2: bool | None = True) <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], see more in Log-Polar 3D (ToMoBAR).
- Parameters:
data (cp.ndarray) – Projection data as a 3d CuPy array.
angles (np.ndarray) – An array of angles given in radians.
center (float, optional) – The center of rotation (CoR).
detector_pad (bool, int) – Detector width padding with edge values to remove circle/arc type artifacts in the reconstruction. Set to True to perform an automated padding or specify a certain value as an integer.
filter_type (str) – Filter type, the accepted strings are: none, ramp, shepp, cosine, cosine2, hamming, hann, parzen.
filter_freq_cutoff (float) – Cutoff frequency parameter for a filter.
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. To implement the cropping one can use the range [0.7-1.0] or set to 2.0 when no cropping required.
- Returns:
The Log-polar Fourier reconstructed volume as a CuPy array.
- Return type:
cp.ndarray
- httomolibgpu.recon.algorithm.SIRT3d_tomobar(data: <cp.ndarray>, angles: <cp.ndarray>, center: float | None = None, detector_pad: bool | int = False, recon_size: int | None = None, recon_mask_radius: float = 0.95, iterations: int = 300, nonnegativity: bool = True, gpu_id: int = 0) <cp.ndarray>[source]#
Perform Simultaneous Iterative Recostruction Technique (SIRT) using ASTRA toolbox [13] and ToMoBAR [6] wrappers. This is 3D recon directly from a CuPy array while using ASTRA GPUlink capability to avoid host-device transactions for projection and backprojection.
- 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).
detector_pad (bool, int) – Detector width padding with edge values to remove circle/arc type artifacts in the reconstruction. Set to True to perform an automated padding or specify a certain value as an integer.
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. To implement the cropping one can use the range [0.7-1.0] or set to 2.0 when no cropping required.
iterations (int) – The number of SIRT iterations.
nonnegativity (bool) – Impose nonnegativity constraint on the reconstructed image.
gpu_id (int) – A GPU device index to perform operation on.
- Returns:
The SIRT reconstructed volume as a CuPy array.
- Return type:
cp.ndarray