RTK  2.6.0
Reconstruction Toolkit
Public Types | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision > Class Template Referenceabstract

#include <rtkFFTProjectionsConvolutionImageFilter.h>

+ Inheritance diagram for rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >:
+ Collaboration diagram for rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >:

Public Types

using ConstPointer = itk::SmartPointer< const Self >
 
using FFTInputImagePointer = typename FFTInputImageType::Pointer
 
using FFTInputImageType = typename itk::Image< TFFTPrecision, TInputImage::ImageDimension >
 
using FFTOutputImagePointer = typename FFTOutputImageType::Pointer
 
using FFTOutputImageType = typename itk::Image< std::complex< TFFTPrecision >, TInputImage::ImageDimension >
 
using IndexType = typename InputImageType::IndexType
 
using InputImageType = TInputImage
 
using OutputImageType = TOutputImage
 
using Pointer = itk::SmartPointer< Self >
 
using RegionType = typename InputImageType::RegionType
 
using Self = FFTProjectionsConvolutionImageFilter
 
using SizeType = typename InputImageType::SizeType
 
using Superclass = itk::ImageToImageFilter< TInputImage, TOutputImage >
 
using ZeroPadFactorsType = itk::Vector< int, 2 >
 

Public Member Functions

virtual const char * GetNameOfClass () const
 
virtual int GetGreatestPrimeFactor () const
 
virtual void SetGreatestPrimeFactor (int _arg)
 
virtual double GetTruncationCorrection () const
 
virtual void SetTruncationCorrection (double _arg)
 
virtual ZeroPadFactorsType GetZeroPadFactors () const
 
virtual void SetZeroPadFactors (ZeroPadFactorsType _arg)
 

Static Public Attributes

static constexpr unsigned int ImageDimension = TOutputImage::ImageDimension
 

Protected Member Functions

void AfterThreadedGenerateData () override
 
void BeforeThreadedGenerateData () override
 
 FFTProjectionsConvolutionImageFilter ()
 
void GenerateInputRequestedRegion () override
 
int GreatestPrimeFactor (int n) const
 
bool IsPrime (int n) const
 
void PrintSelf (std::ostream &os, itk::Indent indent) const override
 
void ThreadedGenerateData (const RegionType &outputRegionForThread, ThreadIdType threadId) override
 
virtual void UpdateFFTProjectionsConvolutionKernel (const SizeType size)=0
 
virtual void UpdateTruncationMirrorWeights ()
 
 ~FFTProjectionsConvolutionImageFilter () override=default
 
virtual FFTInputImagePointer PadInputImageRegion (const RegionType &inputRegion)
 
RegionType GetPaddedImageRegion (const RegionType &inputRegion)
 

Protected Attributes

int m_KernelDimension { 1 }
 
FFTOutputImagePointer m_KernelFFT
 
std::vector< TFFTPrecision > m_TruncationMirrorWeights
 

Private Attributes

int m_BackupNumberOfThreads { 1 }
 
int m_GreatestPrimeFactor { 2 }
 
ZeroPadFactorsType m_ZeroPadFactors
 
double m_TruncationCorrection { 0. }
 
int GetTruncationCorrectionExtent ()
 

Detailed Description

template<class TInputImage, class TOutputImage, class TFFTPrecision>
class rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >

Base class for 1D or 2D FFT based convolution of projections.

The filter code is based on FFTConvolutionImageFilter by Gaetan Lehmann (see https://hdl.handle.net/10380/3154).

Test:
rtkrampfiltertest.cxx, rtkscatterglaretest.cxx
Author
Simon Rit

Definition at line 45 of file rtkFFTProjectionsConvolutionImageFilter.h.

Member Typedef Documentation

◆ ConstPointer

template<class TInputImage , class TOutputImage , class TFFTPrecision >
using rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::ConstPointer = itk::SmartPointer<const Self>

Definition at line 55 of file rtkFFTProjectionsConvolutionImageFilter.h.

◆ FFTInputImagePointer

template<class TInputImage , class TOutputImage , class TFFTPrecision >
using rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::FFTInputImagePointer = typename FFTInputImageType::Pointer

Definition at line 65 of file rtkFFTProjectionsConvolutionImageFilter.h.

◆ FFTInputImageType

template<class TInputImage , class TOutputImage , class TFFTPrecision >
using rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::FFTInputImageType = typename itk::Image<TFFTPrecision, TInputImage::ImageDimension>

Definition at line 64 of file rtkFFTProjectionsConvolutionImageFilter.h.

◆ FFTOutputImagePointer

template<class TInputImage , class TOutputImage , class TFFTPrecision >
using rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::FFTOutputImagePointer = typename FFTOutputImageType::Pointer

Definition at line 67 of file rtkFFTProjectionsConvolutionImageFilter.h.

◆ FFTOutputImageType

template<class TInputImage , class TOutputImage , class TFFTPrecision >
using rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::FFTOutputImageType = typename itk::Image<std::complex<TFFTPrecision>, TInputImage::ImageDimension>

Definition at line 66 of file rtkFFTProjectionsConvolutionImageFilter.h.

◆ IndexType

template<class TInputImage , class TOutputImage , class TFFTPrecision >
using rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::IndexType = typename InputImageType::IndexType

Definition at line 61 of file rtkFFTProjectionsConvolutionImageFilter.h.

◆ InputImageType

template<class TInputImage , class TOutputImage , class TFFTPrecision >
using rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::InputImageType = TInputImage

Some convenient type alias.

Definition at line 58 of file rtkFFTProjectionsConvolutionImageFilter.h.

◆ OutputImageType

template<class TInputImage , class TOutputImage , class TFFTPrecision >
using rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::OutputImageType = TOutputImage

Definition at line 59 of file rtkFFTProjectionsConvolutionImageFilter.h.

◆ Pointer

template<class TInputImage , class TOutputImage , class TFFTPrecision >
using rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::Pointer = itk::SmartPointer<Self>

Definition at line 54 of file rtkFFTProjectionsConvolutionImageFilter.h.

◆ RegionType

template<class TInputImage , class TOutputImage , class TFFTPrecision >
using rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::RegionType = typename InputImageType::RegionType

Definition at line 60 of file rtkFFTProjectionsConvolutionImageFilter.h.

◆ Self

template<class TInputImage , class TOutputImage , class TFFTPrecision >
using rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::Self = FFTProjectionsConvolutionImageFilter

Standard class type alias.

Definition at line 52 of file rtkFFTProjectionsConvolutionImageFilter.h.

◆ SizeType

template<class TInputImage , class TOutputImage , class TFFTPrecision >
using rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::SizeType = typename InputImageType::SizeType

Definition at line 62 of file rtkFFTProjectionsConvolutionImageFilter.h.

◆ Superclass

template<class TInputImage , class TOutputImage , class TFFTPrecision >
using rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::Superclass = itk::ImageToImageFilter<TInputImage, TOutputImage>

Definition at line 53 of file rtkFFTProjectionsConvolutionImageFilter.h.

◆ ZeroPadFactorsType

template<class TInputImage , class TOutputImage , class TFFTPrecision >
using rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::ZeroPadFactorsType = itk::Vector<int, 2>

Definition at line 68 of file rtkFFTProjectionsConvolutionImageFilter.h.

Constructor & Destructor Documentation

◆ FFTProjectionsConvolutionImageFilter()

template<class TInputImage , class TOutputImage , class TFFTPrecision >
rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::FFTProjectionsConvolutionImageFilter ( )
protected

◆ ~FFTProjectionsConvolutionImageFilter()

template<class TInputImage , class TOutputImage , class TFFTPrecision >
rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::~FFTProjectionsConvolutionImageFilter ( )
overrideprotecteddefault

Member Function Documentation

◆ AfterThreadedGenerateData()

template<class TInputImage , class TOutputImage , class TFFTPrecision >
void rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::AfterThreadedGenerateData ( )
overrideprotectedvirtual

Reimplemented from itk::ImageSource< TOutputImage >.

◆ BeforeThreadedGenerateData()

template<class TInputImage , class TOutputImage , class TFFTPrecision >
void rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::BeforeThreadedGenerateData ( )
overrideprotectedvirtual

Reimplemented from itk::ImageSource< TOutputImage >.

◆ GenerateInputRequestedRegion()

template<class TInputImage , class TOutputImage , class TFFTPrecision >
void rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::GenerateInputRequestedRegion ( )
overrideprotectedvirtual

◆ GetGreatestPrimeFactor()

template<class TInputImage , class TOutputImage , class TFFTPrecision >
virtual int rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::GetGreatestPrimeFactor ( ) const
virtual

Set/Get the greatest prime factor allowed on the size of the padded image. The filter increase the size of the image to reach a size with the greatest prime factor smaller or equal to the specified value. The default value is 13, which is the greatest prime number for which the FFT are precomputed in FFTW, and thus gives very good performance. A greatest prime factor of 2 produce a size which is a power of 2, and thus is suitable for vnl base fft filters. A greatest prime factor of 1 or less - typically 0 - disable the extra padding.

Warning: this parameter is not used (and useful) only when ITK is built with FFTW support.

◆ GetNameOfClass()

template<class TInputImage , class TOutputImage , class TFFTPrecision >
virtual const char* rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::GetNameOfClass ( ) const
virtual

◆ GetPaddedImageRegion()

template<class TInputImage , class TOutputImage , class TFFTPrecision >
RegionType rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::GetPaddedImageRegion ( const RegionType inputRegion)
protected

Pad the inputRegion region of the input image and returns a pointer to the new padded image. Padding includes a correction for truncation [Ohnesorge, Med Phys, 2000]. centralRegion is the region of the returned image which corresponds to inputRegion.

◆ GetTruncationCorrection()

template<class TInputImage , class TOutputImage , class TFFTPrecision >
virtual double rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::GetTruncationCorrection ( ) const
virtual

Set/Get the percentage of the image widthfeathered with data to correct for truncation.

◆ GetTruncationCorrectionExtent()

template<class TInputImage , class TOutputImage , class TFFTPrecision >
int rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::GetTruncationCorrectionExtent ( )
private

Percentage of the image width which is feathered with data to correct for truncation. 0 (default) means no correction.

◆ GetZeroPadFactors()

template<class TInputImage , class TOutputImage , class TFFTPrecision >
virtual ZeroPadFactorsType rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::GetZeroPadFactors ( ) const
virtual

Set/Get the zero padding factors in x and y directions. Accepted values are either 1 and 2. The y value is only used if the convolution kernel is 2D.

◆ GreatestPrimeFactor()

template<class TInputImage , class TOutputImage , class TFFTPrecision >
int rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::GreatestPrimeFactor ( int  n) const
protected

◆ IsPrime()

template<class TInputImage , class TOutputImage , class TFFTPrecision >
bool rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::IsPrime ( int  n) const
protected

◆ PadInputImageRegion()

template<class TInputImage , class TOutputImage , class TFFTPrecision >
virtual FFTInputImagePointer rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::PadInputImageRegion ( const RegionType inputRegion)
protectedvirtual

Pad the inputRegion region of the input image and returns a pointer to the new padded image. Padding includes a correction for truncation [Ohnesorge, Med Phys, 2000]. centralRegion is the region of the returned image which corresponds to inputRegion.

◆ PrintSelf()

template<class TInputImage , class TOutputImage , class TFFTPrecision >
void rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::PrintSelf ( std::ostream &  os,
itk::Indent  indent 
) const
overrideprotectedvirtual

◆ SetGreatestPrimeFactor()

template<class TInputImage , class TOutputImage , class TFFTPrecision >
virtual void rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::SetGreatestPrimeFactor ( int  _arg)
virtual

Set/Get the greatest prime factor allowed on the size of the padded image. The filter increase the size of the image to reach a size with the greatest prime factor smaller or equal to the specified value. The default value is 13, which is the greatest prime number for which the FFT are precomputed in FFTW, and thus gives very good performance. A greatest prime factor of 2 produce a size which is a power of 2, and thus is suitable for vnl base fft filters. A greatest prime factor of 1 or less - typically 0 - disable the extra padding.

Warning: this parameter is not used (and useful) only when ITK is built with FFTW support.

◆ SetTruncationCorrection()

template<class TInputImage , class TOutputImage , class TFFTPrecision >
virtual void rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::SetTruncationCorrection ( double  _arg)
virtual

Set/Get the percentage of the image widthfeathered with data to correct for truncation.

◆ SetZeroPadFactors()

template<class TInputImage , class TOutputImage , class TFFTPrecision >
virtual void rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::SetZeroPadFactors ( ZeroPadFactorsType  _arg)
inlinevirtual

Set/Get the zero padding factors in x and y directions. Accepted values are either 1 and 2. The y value is only used if the convolution kernel is 2D.

Definition at line 110 of file rtkFFTProjectionsConvolutionImageFilter.h.

◆ ThreadedGenerateData()

template<class TInputImage , class TOutputImage , class TFFTPrecision >
void rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::ThreadedGenerateData ( const RegionType outputRegionForThread,
ThreadIdType  threadId 
)
overrideprotected

◆ UpdateFFTProjectionsConvolutionKernel()

template<class TInputImage , class TOutputImage , class TFFTPrecision >
virtual void rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::UpdateFFTProjectionsConvolutionKernel ( const SizeType  size)
protectedpure virtual

Creates and return a pointer to the convolution kernel. Can be 1D or 2D. Used in generate data functions, must be implemented in daughter classes.

Implemented in rtk::FFTRampImageFilter< TInputImage, TOutputImage, TFFTPrecision >, rtk::FFTHilbertImageFilter< TInputImage, TOutputImage, TFFTPrecision >, and rtk::ScatterGlareCorrectionImageFilter< TInputImage, TOutputImage, TFFTPrecision >.

◆ UpdateTruncationMirrorWeights()

template<class TInputImage , class TOutputImage , class TFFTPrecision >
virtual void rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::UpdateTruncationMirrorWeights ( )
protectedvirtual

Pre compute weights for truncation correction in a lookup table. The index is the distance to the original image border. Careful: the function is not thread safe but it does nothing if the weights have already been computed.

Member Data Documentation

◆ ImageDimension

template<class TInputImage , class TOutputImage , class TFFTPrecision >
constexpr unsigned int rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::ImageDimension = TOutputImage::ImageDimension
static

ImageDimension constants

Definition at line 71 of file rtkFFTProjectionsConvolutionImageFilter.h.

◆ m_BackupNumberOfThreads

template<class TInputImage , class TOutputImage , class TFFTPrecision >
int rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::m_BackupNumberOfThreads { 1 }
private

Definition at line 204 of file rtkFFTProjectionsConvolutionImageFilter.h.

◆ m_GreatestPrimeFactor

template<class TInputImage , class TOutputImage , class TFFTPrecision >
int rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::m_GreatestPrimeFactor { 2 }
private

Greatest prime factor of the FFT input.

Definition at line 203 of file rtkFFTProjectionsConvolutionImageFilter.h.

◆ m_KernelDimension

template<class TInputImage , class TOutputImage , class TFFTPrecision >
int rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::m_KernelDimension { 1 }
protected

Must be set to fix whether the kernel is 1D or 2D. Will have an effect on the padded region and the input requested region.

Definition at line 179 of file rtkFFTProjectionsConvolutionImageFilter.h.

◆ m_KernelFFT

template<class TInputImage , class TOutputImage , class TFFTPrecision >
FFTOutputImagePointer rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::m_KernelFFT
protected

FFT of the convolution kernel that each daughter class must update.

Definition at line 184 of file rtkFFTProjectionsConvolutionImageFilter.h.

◆ m_TruncationCorrection

template<class TInputImage , class TOutputImage , class TFFTPrecision >
double rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::m_TruncationCorrection { 0. }
private

Percentage of the image width which is feathered with data to correct for truncation. 0 (default) means no correction.

Definition at line 190 of file rtkFFTProjectionsConvolutionImageFilter.h.

◆ m_TruncationMirrorWeights

template<class TInputImage , class TOutputImage , class TFFTPrecision >
std::vector<TFFTPrecision> rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::m_TruncationMirrorWeights
protected

Definition at line 175 of file rtkFFTProjectionsConvolutionImageFilter.h.

◆ m_ZeroPadFactors

template<class TInputImage , class TOutputImage , class TFFTPrecision >
ZeroPadFactorsType rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::m_ZeroPadFactors
private

Zero padding factors in x and y directions. Accepted values are either 1 and 2. The y value is only used if the convolution kernel is 2D.

Definition at line 198 of file rtkFFTProjectionsConvolutionImageFilter.h.


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