CTL  0.6.1
Computed Tomography Library
Public Types | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
CTL::OCL::ApodizationFilter Class Reference

The ApodizationFilter class is an OpenCL implementation of several apodization functions. More...

#include <oclprojectionfilters.h>

Inheritance diagram for CTL::OCL::ApodizationFilter:
Inheritance graph
[legend]
Collaboration diagram for CTL::OCL::ApodizationFilter:
Collaboration graph
[legend]

Public Types

enum  { Type = 3103 }
 
enum  FilterType { RamLak, SheppLogan, Cosine, Hann }
 
- Public Types inherited from CTL::OCL::GenericOCLProjectionFilter
enum  { Type = 3100 }
 
- Public Types inherited from CTL::AbstractProjectionFilter
enum  { Type = 3000 }
 
- Public Types inherited from CTL::SerializationInterface
enum  { Type = -1, UserType = 65536 }
 

Public Member Functions

int type () const override
 
void filter (ProjectionData &projections) override
 Applies the apodization filter operation to projections.
 
 ApodizationFilter (FilterType filterType, float frequencyScaling=1.0f)
 Constructs an ApodizationFilter object. More...
 
QVariant parameter () const override
 Returns the parameters of this instance as a QVariant. More...
 
void setParameter (const QVariant &parameter) override
 Sets the parameters of this instance based on the passed QVariant parameter. More...
 
- Public Member Functions inherited from CTL::OCL::GenericOCLProjectionFilter
 GenericOCLProjectionFilter (const std::string &clFileName, const std::vector< float > &arguments={})
 Creates a GenericOCLProjectionFilter instance that is capable of executing the OpenCL kernel (filter) of the file clFileName. More...
 
void setAdditionalKernelArg (float argument)
 Convenience method for simpler setting of a single additional argument. More...
 
void setAdditionalKernelArgs (const std::vector< float > &arguments)
 Sets the additional kernel arguments to arguments. More...
 
- Public Member Functions inherited from CTL::AbstractProjectionFilter
void fromVariant (const QVariant &variant) override
 
QVariant toVariant () const override
 
- Public Member Functions inherited from CTL::SerializationInterface
virtual ~SerializationInterface ()=default
 

Private Member Functions

 ApodizationFilter ()
 Default ctor; private. Used for purpose of deserialization only.
 
std::vector< float > generateCoefficients (unsigned filterSize) const
 Generates the coefficients for a filter of size filterSize.
 

Static Private Member Functions

static QMetaEnum metaEnum ()
 QMetaEnum object used to decode/encode subset order enum values.
 

Private Attributes

FilterType _filterType
 
float _frequencyScaling = 1.0f
 
std::vector< float > _filter
 

Friends

template<class >
struct SerializationHelper::RegisterWithSerializationHelper
 

Additional Inherited Members

- Protected Member Functions inherited from CTL::OCL::GenericOCLProjectionFilter
 GenericOCLProjectionFilter ()
 Creates a GenericOCLProjectionFilter without any OpenCL kernel associated to it. More...
 
 GenericOCLProjectionFilter (cl::Kernel *kernel, const std::vector< float > &arguments={})
 Creates a GenericOCLProjectionFilter that executes the OpenCL kernel kernel. More...
 
virtual cl::NDRange globalWorksize (const ProjectionData &projections) const
 Returns the global worksize for the kernel call. More...
 
virtual cl::NDRange localWorksize (const ProjectionData &projections) const
 Returns the local worksize for the kernel call. More...
 
virtual bool autoCombine () const
 Returns true if projections will be automatically combined before being processed by the kernel. More...
 
- Protected Member Functions inherited from CTL::AbstractProjectionFilter
 AbstractProjectionFilter (const AbstractProjectionFilter &)=default
 
 AbstractProjectionFilter (AbstractProjectionFilter &&)=default
 
AbstractProjectionFilteroperator= (const AbstractProjectionFilter &)=default
 
AbstractProjectionFilteroperator= (AbstractProjectionFilter &&)=default
 
- Protected Member Functions inherited from CTL::SerializationInterface
 SerializationInterface ()=default
 
 SerializationInterface (const SerializationInterface &)=default
 
 SerializationInterface (SerializationInterface &&)=default
 
SerializationInterfaceoperator= (const SerializationInterface &)=default
 
SerializationInterfaceoperator= (SerializationInterface &&)=default
 
- Protected Attributes inherited from CTL::OCL::GenericOCLProjectionFilter
std::string _clFileName
 
std::vector< float > _additionalArgs
 
cl::Kernel * _kernel
 
cl::CommandQueue _queue
 

Detailed Description

The ApodizationFilter class is an OpenCL implementation of several apodization functions.

For direct reconstructions of volumes from X-ray projections, e.g. using FDKReconstructor, the Ram-Lak filter is applied on the projections in frequency domain. Due to the discrete nature of detector pixels, the Ram-Lak filter is band-limited and sampled at discrete positions, which leads to spectral leakage. Moreover, in case of a low signal-to-noise ratio of the projections, it is sensible to attenuate high frequency content to reduce noise in the reconstructions. Apodization functions, also known as window functions, are used to handle these two problems. They are (usually) symmetric functions that are zero-valued outside a certain interval. For CT reconstruction, they are multiplied with the Ram-Lak filter in frequency domain.

Member Enumeration Documentation

◆ FilterType

Enumerator
RamLak 

No apodization.

This is the only apodization type that does not need to calculate the discrete Fourier transform and its inverse if \(s=1\).

SheppLogan 

Multiplies the Ram-Lak filter by the sinc function.

\[ \mathrm{apod}(\omega) = \frac{\sin(s^{-1}\omega)}{s^{-1}\omega} \]

L. A. Shepp and B. F. Logan, "The Fourier reconstruction of a head section," in IEEE Transactions on Nuclear Science, vol. 21, no. 3, pp. 21-43, June 1974, doi: 10.1109/TNS.1974.6499235.

Cosine 

Multiplies the Ram-Lak filter by the cosine function.

\[ \mathrm{apod}(\omega) = \cos(0.5s^{-1}\omega) \]

F. J. Harris, "On the use of windows for harmonic analysis with the discrete Fourier transform," in Proceedings of the IEEE, vol. 66, no. 1, pp. 51-83, Jan. 1978, doi: 10.1109/PROC.1978.10837.

Hann 

Multiplies the Ram-Lak filter by the Hann window.

\[ \mathrm{apod}(\omega) = \frac{1}{2}(1 + \cos(s^{-1}\omega)) \]

R. B. Blackman and J. W. Tukey, "The measurement of power spectra from the point of view of communications engineering — Part I," in The Bell System Technical Journal, vol. 37, no. 1, pp. 185-282, Jan. 1958, doi: 10.1002/j.1538-7305.1958.tb03874.x.

Constructor & Destructor Documentation

◆ ApodizationFilter()

CTL::OCL::ApodizationFilter::ApodizationFilter ( FilterType  filterType,
float  frequencyScaling = 1.0f 
)
explicit

Constructs an ApodizationFilter object.

Parameters
filterTypeType of the apodization filter
frequencyScalingScaling of the apodization function along frequency axis. Can take values in \((0, 1]\). Frequencies above/below the cutoff frequency calculated from this scaling factor are set to zero.

Member Function Documentation

◆ parameter()

QVariant CTL::OCL::ApodizationFilter::parameter ( ) const
overridevirtual

Returns the parameters of this instance as a QVariant.

Returns a QVariantMap including the following (key, value)-pairs:

  • information from the base class (GenericOCLProjectionFilter),
  • ("frequency scaling", [float] scaling of the apodization function),
  • ("filter type", [string] name of the filter type).

Reimplemented from CTL::OCL::GenericOCLProjectionFilter.

◆ setParameter()

void CTL::OCL::ApodizationFilter::setParameter ( const QVariant &  parameter)
overridevirtual

Sets the parameters of this instance based on the passed QVariant parameter.

The passed parameter must be a QVariantMap containing one or more of the following (key, value)-pairs:

  • information from the base class (GenericOCLProjectionFilter),
  • ("frequency scaling", [float] scaling of the apodization function),
  • ("filter type", [string] name of the filter type).

Note that changing parameters of the base class this way (esp. changing the OpenCL kernel file) leads to undefined behavior.

Reimplemented from CTL::OCL::GenericOCLProjectionFilter.

◆ type()

int CTL::OCL::ApodizationFilter::type ( ) const
inlineoverridevirtual

Returns the type-id of the serializable object. Used in deserialization to determine the proper object type.

Add derived classes to the enumeration using the CTL_TYPE_ID macro.

Reimplemented from CTL::OCL::GenericOCLProjectionFilter.


The documentation for this class was generated from the following files: