nabu.reconstruction.fbp_base module¶
- class nabu.reconstruction.fbp_base.BackprojectorBase(sino_shape, slice_shape=None, angles=None, rot_center=None, padding_mode=None, halftomo=False, filter_name=None, slice_roi=None, scale_factor=None, extra_options=None, backend_options=None)[source]¶
Bases:
object
Base class for backprojectors.
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 anles 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_x and end_y are non inclusive ! For example if the detector has 2048 pixels horizontally, then you can choose start_x=0 and end_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)
scale_factor (float, optional) – Scaling factor for backprojection. For example, to get the linear absorption coefficient in 1/cm, this factor has to be set as the pixel size in cm. DEPRECATED - please use this parameter in “extra_options”
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.
extra_options –
- Dictionary with a set of advanced options. The default are the following:
- ”padding_mode”: “zeros”
Padding mode when filtering the sinogram. Can be “zeros” or “edges”. DEPRECATED - please use “padding_mode” directly in parameters.
- ”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
Scaling factor for backprojection. For example, to get the linear absorption coefficient in 1/cm, this factor has to be set as the pixel size in cm.
- 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
- backend = 'numpy'¶
- default_padding_mode = 'zeros'¶
- kernel_name = 'backproj'¶
- default_extra_options = {'axis_correction': None, 'centered_axis': False, 'clip_outer_circle': False, 'filter_cutoff': 1.0, 'padding_mode': None, 'scale_factor': None}¶
- kernel_filename = None¶
- backend_processing_class¶
alias of
ProcessingBase
- SinoFilterClass¶
alias of
SinoFilter
- reset_rot_center(rot_center)[source]¶
Define a new center of rotation for the current backprojector.
- fbp(sino, output=None)¶