tomobar.methodsDIR
#
Reconstruction class for direct reconstruction methods (2D/3D).
RecToolsDIR.FORWPROJ()
andRecToolsDIR.BACKPROJ()
Forward/Backward 2D/3D projection (ASTRA-Toolbox)RecToolsDIR.FOURIER()
Fourier Slice Theorem-based reconstruction in 2D only (adopted from the Tim Day’s code)RecToolsDIR.FBP()
Filtered Back Projection 2D/3D (ASTRA with the custom built filter).
- class tomobar.methodsDIR.RecToolsDIR(DetectorsDimH, DetectorsDimV, CenterRotOffset, AnglesVec, ObjSize, device_projector='gpu')[source]#
Bases:
object
Reconstruction class using DIRect methods (FBP and Fourier).
- Parameters:
DetectorsDimH (int) – Horizontal detector dimension.
DetectorsDimV (int) – Vertical detector dimension for 3D case, 0 or None for 2D case.
CenterRotOffset (float, ndarray) – The Centre of Rotation (CoR) scalar or a vector for each angle.
AnglesVec (np.ndarray) – Vector of projection angles in radians.
ObjSize (int) – Reconstructed object dimensions (a scalar).
device_projector (str, int, optional) – ‘cpu’ or ‘gpu’ device OR provide a GPU index (integer) of a specific GPU device.
cupyrun (bool, optional) – instantiate CuPy class if True.
- BACKPROJ(projdata: <cp.ndarray>, **kwargs) <cp.ndarray> [source]#
Module to perform back-projection of 2d/3d data numpy array
- Parameters:
projdata (np.ndarray) – 2D/3D projection data
- Keyword Arguments:
data_axes_labels_order (Union[list, None], optional) – The order of the axes labels for the input data. When “None” we assume [“angles”, “detX”] for 2D and [“detY”, “angles”, “detX”] for 3D.
- Returns:
Backprojected 2D/3D object
- Return type:
np.ndarray
- FBP(data: <cp.ndarray>, **kwargs) <cp.ndarray> [source]#
Filtered backprojection reconstruction module for 2D or 3D data.
- Parameters:
data (np.ndarray) – 2D or 3D projection data.
- Keyword Arguments:
data_axes_labels_order (Union[list, None], optional) – The order of the axes labels for the input data. When “None” we assume [“angles”, “detX”] for 2D and [“detY”, “angles”, “detX”] for 3D.
- Returns:
FBP reconstructed 2D or 3D object.
- Return type:
np.ndarray
- FORWPROJ(data: <cp.ndarray>, **kwargs) <cp.ndarray> [source]#
Module to perform forward projection of 2d/3d data numpy array
- Parameters:
data (np.ndarray) – 2D or 3D object
- Keyword Arguments:
data_axes_labels_order (Union[list, None], optional) – The order of the axes labels for the OUTPUT data. When “None” we assume [“angles”, “detX”] for 2D and [“detY”, “angles”, “detX”] for 3D.
- Returns:
Forward projected numpy array (projection data)
- Return type:
np.ndarray
- FOURIER(data: <cp.ndarray>, **kwargs) <cp.ndarray> [source]#
2D Reconstruction using Fourier slice theorem (scipy required) for griddata interpolation module choose nearest, linear or cubic
- Parameters:
data (np.ndarray) – 2D sinogram data
- Keyword Arguments:
data_axes_labels_order (Union[list, None], optional) – The order of the axes labels for the input data. When “None” we assume [“angles”, “detX”] for 2D and [“detY”, “angles”, “detX”] for 3D.
method (str, optional) – Interpolation type (nearest, linear, or cubic). Defaults to “linear”.
- Returns:
Reconstructed object
- Return type:
np.ndarray