sinofilter: Sinogram filtering.#

Module for sinogram filtering on CPU/GPU.

class SinoFilter(sino_shape, filter_name=None, ctx=None, devicetype='all', platformid=None, deviceid=None, profile=False, extra_options=None)[source]#

Bases: OpenclProcessing

A class for performing sinogram filtering on GPU using OpenCL.

This is a convolution in the Fourier space, along one dimension:

  • In 2D: (n_a, d_x): n_a filterings (1D FFT of size d_x)

  • In 3D: (n_z, n_a, d_x): n_z*n_a filterings (1D FFT of size d_x)

set_filter(h_filt, normalize=True)[source]#

Set a filter for sinogram filtering.

Parameters:
  • h_filt – Filter. Each line of the sinogram will be filtered with this filter. It has to be the Real-to-Complex Fourier Transform of some real filter, padded to 2*sinogram_width.

  • normalize – Whether to normalize the filter with pi/num_angles.

copy2d(dst, src, transfer_shape, dst_offset=(0, 0), src_offset=(0, 0))[source]#
Parameters:
  • dst

  • src

  • transfer_shape

  • dst_offset

  • src_offset

copy2d_host(dst, src, transfer_shape, dst_offset=(0, 0), src_offset=(0, 0))[source]#
Parameters:
  • dst

  • src

  • transfer_shape

  • dst_offset

  • src_offset

filter_sino(sino, output=None)[source]#
Parameters:
  • sino – sinogram

  • output

Returns:

filtered sinogram