nabu.reconstruction.hbp
source module nabu.reconstruction.hbp
Classes
-
HierarchicalBackprojector — Initialize a Backprojector.
Functions
-
buildConebeamGeometry — Generate fanbeam/conebeam projection matrices (as required by the backprojector) based on geometry parameters
source buildConebeamGeometry(anglesRad, rotAxisProjectionFromLeftPixelUnits, sourceSampleDistanceVoxelUnits, opticalAxisFromLeftPixelUnits=None)
Generate fanbeam/conebeam projection matrices (as required by the backprojector) based on geometry parameters
source class HierarchicalBackprojector(sino_shape, slice_shape=None, angles=None, rot_center=None, padding_mode=None, halftomo=False, filter_name=None, slice_roi=None, extra_options=None, backend_options=None)
Bases : CudaBackprojector
Initialize a Backprojector.
Parameters
-
sino_shape : tuple — Shape of the sinogram, in the form
(n_angles, detector_width)(for backprojecting one sinogram) or(n_sinos, n_angles, detector_width). -
slice_shape : int or tuple, optional — Shape of the slice. By default, the slice shape is (n_x, n_x) where
n_x = detector_width -
angles : array-like, optional — Rotation angles in radians. By default, angles are equispaced between [0, pi[.
-
rot_center : float, optional — Rotation axis position. Default is
(detector_width - 1)/2.0 -
padding_mode : str, optional — Padding mode when filtering the sinogram. Can be "zeros" (default) or "edges".
-
filter_name : str, optional — Name of the filter for filtered-backprojection.
-
slice_roi : tuple, optional. — Whether to backproject in a restricted area. If set, it must be in the form (start_x, end_x, start_y, end_y).
end_xandend_yare non inclusive ! For example if the detector has 2048 pixels horizontally, then you can choosestart_x=0andend_x=2048. If one of the value is set to None, it is replaced with a default value (0 for start, n_x and n_y for end) -
extra_options : dict, optional — Advanced extra options. See the "Extra options" section for more information.
-
backend_options : dict, optional — OpenCL/Cuda options passed to the OpenCLProcessing or CudaProcessing class.
Other Parameters
extra_options: dict, optional Dictionary with a set of advanced options. The default are the following: - "axis_correction": None Whether to set a correction for the rotation axis. If set, this should be an array with as many elements as the number of angles. This is useful when there is an horizontal displacement of the rotation axis. - centered_axis: bool Whether to "center" the slice on the rotation axis position. If set to True, then the reconstructed region is centered on the rotation axis. - scale_factor: float Extra Scaling factor for backprojection. It will multiply the '1/pixel_size_cm' normalization - clip_outer_circle: False Whether to set to zero the pixels outside the reconstruction mask - filter_cutoff: float Cut-off frequency usef for Fourier filter. Default is 1.0 - pixel_size_cm: float Size of the projection pixel for filtering. Default is 1.0. Normally the filtering step is scaled with the pixel size, so that the output is the linear attenuation coefficient in 1/cm
Methods
source method HierarchicalBackprojector.setup_hbp(bpgeometry, reductionFactor=20, grid_wh_factors=(1, 1), fac=1, legs=4)
Raises
-
ValueError
source method HierarchicalBackprojector.backproj(sino, output=None, do_checks=True, reference=False)
source get_max_grid_size(grids)
source getGridSize(minimum, local)