7.2.4. algotom.prep.filtering

Module of filtering methods in the preprocessing stage:

  • Fresnel filter (denoising or low-pass filter), a simplified version of the well-known Paganin’s filter.

  • Double-wedge filter.

Functions:

make_fresnel_window(height, width, ratio, dim)

Create a low pass window based on the Fresnel propagator.

fresnel_filter(mat, ratio[, dim, window, ...])

Apply a low-pass filter based on the Fresnel propagator to an image (Ref.

make_double_wedge_mask(height, width, radius)

Generate a double-wedge binary mask using Eq.

double_wedge_filter(sinogram[, center, ...])

Apply double-wedge filter to a sinogram image (Ref.

algotom.prep.filtering.make_fresnel_window(height, width, ratio, dim)[source]

Create a low pass window based on the Fresnel propagator. It is used to denoise a projection image (dim=2) or a sinogram image (dim=1).

Parameters
  • height (int) – Image height

  • width (int) – Image width

  • ratio (float) – To define the shape of the window.

  • dim ({1, 2}) – Use “1” if working on a sinogram image and “2” if working on a projection image.

Returns

array_like – 2D array.

algotom.prep.filtering.fresnel_filter(mat, ratio, dim=1, window=None, pad=150, apply_log=True)[source]

Apply a low-pass filter based on the Fresnel propagator to an image (Ref. [1]). It can be used for improving the contrast of an image. It’s simpler than the well-known Paganin’s filter (Ref. [2]).

Parameters
  • mat (array_like) – 2D array. Projection image or sinogram image.

  • ratio (float) – Define the shape of the window. Larger is more smoothing.

  • dim ({1, 2}) – Use “1” if working on a sinogram image and “2” if working on a projection image.

  • window (array_like, optional) – Window for deconvolution.

  • pad (int) – Padding width.

  • apply_log (bool, optional) – Apply the logarithm function to the sinogram before filtering.

Returns

array_like – 2D array. Filtered image.

References

[1] : https://doi.org/10.1364/OE.418448

[2] : https://tinyurl.com/2f8nv875

algotom.prep.filtering.make_double_wedge_mask(height, width, radius)[source]

Generate a double-wedge binary mask using Eq. (3) in Ref. [1]. Values outside the double-wedge region correspond to 0.0.

Parameters
  • height (int) – Image height.

  • width (int) – Image width.

  • radius (int) – Radius of an object, in pixel unit.

Returns

array_like – 2D binary mask.

References

[1] : https://doi.org/10.1364/OE.22.019078

algotom.prep.filtering.double_wedge_filter(sinogram, center=0, sino_type='180', iteration=5, mask=None, ratio=1.0, pad=250)[source]

Apply double-wedge filter to a sinogram image (Ref. [1]).

Parameters
  • sinogram (array_like) – 2D array. 180-degree sinogram or 360-degree sinogram.

  • center (float, optional) – Center-of-rotation. No need for a 360-sinogram.

  • sino_type ({“180”, “360”}) – Sinogram type : 180-degree or 360-degree.

  • iteration (int) – Number of iteration.

  • mask (array_like, optional) – Double-wedge binary mask.

  • ratio (float, optional) – Define the cut-off angle of the double-wedge filter.

  • pad (int) – Padding width.

Returns

array_like – 2D array. Filtered sinogram.

References

[1] : https://doi.org/10.1364/OE.418448