nabu.pipeline.helical.fbp module

class nabu.pipeline.helical.fbp.BackprojectorHelical(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: CudaBackprojector

This is the Backprojector derived class for helical reconstruction. The modifications are detailed here :

  • the backprojection is decoupled from the filtering. This allows, in the pipeline, for doing first a filtering using backprojector_object.sino_filter subobject, then calling backprojector_object.backprojection only after reweigthing the result of the filter_sino method of sino_filter subobject.

  • the angles can be resetted on the fly, and the class can work with a variable number of projection. As a matter of fact, with the helical_chunked_regridded.py pipeline, the reconstruction is done each time with the same set of angles, this because of the regridding mechanism. The feature might return useful in the future if alternative approachs are developed again.

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

set_custom_angles_and_axis_corrections(angles_rad, x_per_proj)[source]

To arbitrarily change angles :param angles_rad: one angle per each projection in radians :type angles_rad: array of floats :param x_per_proj: each entry is the axis shift for a projection, in pixels. :type x_per_proj: array of floats

backprojection(sino, output=None)[source]

Redefined here to do backprojection only, compare to the base class method.