tomobar.methodsDIR
#
Reconstruction class for direct reconstructon methods.
Fourier Slice Theorem reconstruction (adopted from Tim Day’s code)
Forward/Backward projection (ASTRA)
Filtered Back Projection (ASTRA)
- 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: numpy.ndarray, **kwargs) numpy.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: numpy.ndarray, **kwargs) numpy.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: numpy.ndarray, **kwargs) numpy.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: numpy.ndarray, **kwargs) numpy.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