RTK  1.4.0
Reconstruction Toolkit
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | 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

typedef itk::SmartPointer< const SelfConstPointer
 
typedef FFTInputImageType::Pointer FFTInputImagePointer
 
typedef itk::Image< TFFTPrecision, TInputImage::ImageDimensionFFTInputImageType
 
typedef FFTOutputImageType::Pointer FFTOutputImagePointer
 
typedef itk::Image< std::complex< TFFTPrecision >, TInputImage::ImageDimensionFFTOutputImageType
 
typedef InputImageType::IndexType IndexType
 
typedef TInputImage InputImageType
 
typedef TOutputImage OutputImageType
 
typedef itk::SmartPointer< SelfPointer
 
typedef InputImageType::RegionType RegionType
 
typedef FFTProjectionsConvolutionImageFilter Self
 
typedef InputImageType::SizeType SizeType
 
typedef itk::ImageToImageFilter< TInputImage, TOutputImage > Superclass
 
typedef itk::Vector< int, 2 > ZeroPadFactorsType
 

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 const 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 ()
 
virtual ~FFTProjectionsConvolutionImageFilter () override
 
virtual FFTInputImagePointer PadInputImageRegion (const RegionType &inputRegion)
 
RegionType GetPaddedImageRegion (const RegionType &inputRegion)
 

Protected Attributes

int m_KernelDimension
 
FFTOutputImagePointer m_KernelFFT
 
std::vector< TFFTPrecision > m_TruncationMirrorWeights
 

Private Member Functions

 FFTProjectionsConvolutionImageFilter (const Self &)
 
void operator= (const Self &)
 

Private Attributes

int m_BackupNumberOfThreads
 
int m_GreatestPrimeFactor
 
ZeroPadFactorsType m_ZeroPadFactors
 
double m_TruncationCorrection
 
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 http://hdl.handle.net/10380/3154).

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

Definition at line 45 of file rtkFFTProjectionsConvolutionImageFilter.h.

Member Typedef Documentation

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

Definition at line 53 of file rtkFFTProjectionsConvolutionImageFilter.h.

template<class TInputImage , class TOutputImage , class TFFTPrecision >
typedef FFTInputImageType::Pointer rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::FFTInputImagePointer

Definition at line 64 of file rtkFFTProjectionsConvolutionImageFilter.h.

template<class TInputImage , class TOutputImage , class TFFTPrecision >
typedef itk::Image<TFFTPrecision, TInputImage::ImageDimension > rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::FFTInputImageType

Definition at line 63 of file rtkFFTProjectionsConvolutionImageFilter.h.

template<class TInputImage , class TOutputImage , class TFFTPrecision >
typedef FFTOutputImageType::Pointer rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::FFTOutputImagePointer

Definition at line 67 of file rtkFFTProjectionsConvolutionImageFilter.h.

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

Definition at line 66 of file rtkFFTProjectionsConvolutionImageFilter.h.

template<class TInputImage , class TOutputImage , class TFFTPrecision >
typedef InputImageType::IndexType rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::IndexType

Definition at line 59 of file rtkFFTProjectionsConvolutionImageFilter.h.

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

Some convenient typedefs.

Definition at line 56 of file rtkFFTProjectionsConvolutionImageFilter.h.

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

Definition at line 57 of file rtkFFTProjectionsConvolutionImageFilter.h.

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

Definition at line 52 of file rtkFFTProjectionsConvolutionImageFilter.h.

template<class TInputImage , class TOutputImage , class TFFTPrecision >
typedef InputImageType::RegionType rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::RegionType

Definition at line 58 of file rtkFFTProjectionsConvolutionImageFilter.h.

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

Standard class typedefs.

Definition at line 50 of file rtkFFTProjectionsConvolutionImageFilter.h.

template<class TInputImage , class TOutputImage , class TFFTPrecision >
typedef InputImageType::SizeType rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::SizeType

Definition at line 60 of file rtkFFTProjectionsConvolutionImageFilter.h.

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

Definition at line 51 of file rtkFFTProjectionsConvolutionImageFilter.h.

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

Definition at line 68 of file rtkFFTProjectionsConvolutionImageFilter.h.

Constructor & Destructor Documentation

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

Definition at line 121 of file rtkFFTProjectionsConvolutionImageFilter.h.

References GreatestPrimeFactor(), and IsPrime().

template<class TInputImage , class TOutputImage , class TFFTPrecision >
rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::FFTProjectionsConvolutionImageFilter ( const Self )
private

Member Function Documentation

template<class TInputImage , class TOutputImage , class TFFTPrecision >
void rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::AfterThreadedGenerateData ( )
overrideprotected
template<class TInputImage , class TOutputImage , class TFFTPrecision >
void rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::BeforeThreadedGenerateData ( )
overrideprotected
template<class TInputImage , class TOutputImage , class TFFTPrecision >
void rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::GenerateInputRequestedRegion ( )
overrideprotected
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.

template<class TInputImage , class TOutputImage , class TFFTPrecision >
virtual const char* rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::GetNameOfClass ( ) const
virtual
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.

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.

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.

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.

template<class TInputImage , class TOutputImage , class TFFTPrecision >
int rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::GreatestPrimeFactor ( int  n) const
protected
template<class TInputImage , class TOutputImage , class TFFTPrecision >
bool rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::IsPrime ( int  n) const
protected
template<class TInputImage , class TOutputImage , class TFFTPrecision >
void rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::operator= ( const Self )
private
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.

template<class TInputImage , class TOutputImage , class TFFTPrecision >
void rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::PrintSelf ( std::ostream &  os,
itk::Indent  indent 
) const
overrideprotected
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.

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.

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 105 of file rtkFFTProjectionsConvolutionImageFilter.h.

template<class TInputImage , class TOutputImage , class TFFTPrecision >
void rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::ThreadedGenerateData ( const RegionType outputRegionForThread,
ThreadIdType  threadId 
)
overrideprotected
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 >, and rtk::ScatterGlareCorrectionImageFilter< TInputImage, TOutputImage, TFFTPrecision >.

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

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

ImageDimension constants

Definition at line 72 of file rtkFFTProjectionsConvolutionImageFilter.h.

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

Definition at line 190 of file rtkFFTProjectionsConvolutionImageFilter.h.

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

Greatest prime factor of the FFT input.

Definition at line 189 of file rtkFFTProjectionsConvolutionImageFilter.h.

template<class TInputImage , class TOutputImage , class TFFTPrecision >
int rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::m_KernelDimension
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 163 of file rtkFFTProjectionsConvolutionImageFilter.h.

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 168 of file rtkFFTProjectionsConvolutionImageFilter.h.

template<class TInputImage , class TOutputImage , class TFFTPrecision >
double rtk::FFTProjectionsConvolutionImageFilter< TInputImage, TOutputImage, TFFTPrecision >::m_TruncationCorrection
private

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

Definition at line 177 of file rtkFFTProjectionsConvolutionImageFilter.h.

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

Definition at line 159 of file rtkFFTProjectionsConvolutionImageFilter.h.

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 184 of file rtkFFTProjectionsConvolutionImageFilter.h.


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