Image Component Library (ICL)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Private Member Functions | Private Attributes
icl::filter::IFFTOp Class Reference

This class implements the unary operator for the inverse fast and discrete 2D fourier transformation. More...

#include <IFFTOp.h>

Inheritance diagram for icl::filter::IFFTOp:
icl::filter::UnaryOp icl::utils::Configurable

List of all members.

Public Types

enum  SizeAdaptionMode { NO_SCALE, PAD_REMOVE, SCALE_UP, SCALE_DOWN }
 Modes how the sourceimage is to adapt before fftcomputation. More...
enum  ResultMode { REAL_ONLY, IMAG_ONLY, TWO_CHANNEL_COMPLEX }

Public Member Functions

 IFFTOp (ResultMode rm=REAL_ONLY, SizeAdaptionMode sam=NO_SCALE, utils::Rect roi=Rect(0, 0, 0, 0), bool join=true, bool ifftshift=true, bool forceIDFT=false)
 Creates a new IFFTOp-object.
 ~IFFTOp ()
void setJoinMatrix (bool pJoin)
 Sets if two channels shall be joined to one complex.
bool getJoinMatrix ()
 Returns if two channels shall be joined to one complex.
void setROI (utils::Rect roi)
 Sets the roi.
Rect getRoi ()
 Returns the current roi.
void setResultMode (ResultMode rm)
 Sets the resultmode.
int getResultMode ()
 Returns the resultmode as int.
void setSizeAdaptionMode (SizeAdaptionMode sam)
 Sets the sizeadaptionmode.
int getSizeAdaptionMode ()
 Returns the sizeadaptionmode.
bool getForceIDFT ()
 Returns true if the discrete inverse fourier transfarmation shall be used, else false.
void setForceIDFT (bool pForceDFT)
 Set wether to force the discrete inverse fourier transformation or to use the fast inverse fourier transformation.
virtual void apply (const core::ImgBase *src, core::ImgBase **dst)
 Call this method to start ifftcomputation.

Private Member Functions

template<class SrcT , class DstT >
void apply_internal (const core::Img< SrcT > &src, core::Img< DstT > &dst, math::DynMatrix< std::complex< DstT > > &buf, math::DynMatrix< std::complex< DstT > > &dstBuf)
template<class T >
const core::Img< T > * adapt_source (const core::Img< T > *src)
template<typename T >
void apply_inplace_ifftshift (math::DynMatrix< T > &m)

Private Attributes

Data * m_data
 Class for internal params and buffers.

Detailed Description

This class implements the unary operator for the inverse fast and discrete 2D fourier transformation.

As known the ifft can only be applied if the datasize is a power of 2. This implementation uses the ifft as far as it can be applied and switches to the idft, so you can use it if datasize is not a power of 2 too. If MKL or IPP is available, IFFTOp tries to use it if possible.


Member Enumeration Documentation

Several resultmodes for destinationimage.

Enumerator:
REAL_ONLY 

alternates real- and imaginarypart of ifftcomputation

IMAG_ONLY 

imaginarypart of ifftcomputation

TWO_CHANNEL_COMPLEX 

realpart of ifftcomputation

Modes how the sourceimage is to adapt before fftcomputation.

Several sizeadaptionmodes for sourceimage.

Enumerator:
NO_SCALE 

sourceimage stays as is

PAD_REMOVE 

removes PAD_MIRROR,PAD_ZERO and PAD_COPY from the sourceimage(new size is given from contructorparameter roi)

SCALE_UP 

zooms to next higher power of 2 of originsize, or origanalsize if it is power of 2

SCALE_DOWN 

zooms to next lower power of 2 of originsize, or origanalsize if it is power of 2


Constructor & Destructor Documentation

icl::filter::IFFTOp::IFFTOp ( ResultMode  rm = REAL_ONLY,
SizeAdaptionMode  sam = NO_SCALE,
utils::Rect  roi = Rect(0, 0, 0, 0),
bool  join = true,
bool  ifftshift = true,
bool  forceIDFT = false 
)

Creates a new IFFTOp-object.

Constructor. Params can be changed later.

Parameters:
rmthe resultmode
samthe sizeadaptionmode before applying IFFTOp
roideterminates the size if removing padding is needed
joinwether to join to channel to one complex for the ifftcomputation or not
ifftshiftundo fftshift before the isfftcomputation or not
forceIDFTwether to apply idft or ifft

Destructor


Member Function Documentation

template<class T >
const core::Img<T>* icl::filter::IFFTOp::adapt_source ( const core::Img< T > *  src) [private]

Called by apply. Adapts sourceimage to specified values(scaling, padding on so on). Possible sourceparam is: Img<icl8u>, Img<icl16s>, Img<icl32s>, Img<icl32f>, Img<icl64f>

virtual void icl::filter::IFFTOp::apply ( const core::ImgBase src,
core::ImgBase **  dst 
) [virtual]

Call this method to start ifftcomputation.

Applies IFFTOp on src and dst.

Parameters:
*srcpointer to sourceimage
**dstpointer to pointer to destinationimage

Implements icl::filter::UnaryOp.

template<typename T >
void icl::filter::IFFTOp::apply_inplace_ifftshift ( math::DynMatrix< T > &  m) [private]

Applies inplace ifftshift on destinationimage after ifftcomputation. Possible sourceparam is: Img<icl32f> and Img<icl64f>

template<class SrcT , class DstT >
void icl::filter::IFFTOp::apply_internal ( const core::Img< SrcT > &  src,
core::Img< DstT > &  dst,
math::DynMatrix< std::complex< DstT > > &  buf,
math::DynMatrix< std::complex< DstT > > &  dstBuf 
) [private]

Called by apply. Aplies ifft/idft and resultmode. Possible sourceparam is: Img<icl8u>, Img<icl16s>, Img<icl32s>, Img<icl32f>, Img<icl64f>. Possible destinationparam is: Img<icl32f> and Img<icl64f>.

Returns true if the discrete inverse fourier transfarmation shall be used, else false.

Returns:
true for idft, false for ifft

Returns if two channels shall be joined to one complex.

Returns:
the current value

Returns the resultmode as int.

Returns:
the current resultmode.

Returns the current roi.

Returns:
roi the current roi

Returns the sizeadaptionmode.

Returns:
the current sizeadationmode
void icl::filter::IFFTOp::setForceIDFT ( bool  pForceDFT)

Set wether to force the discrete inverse fourier transformation or to use the fast inverse fourier transformation.

Parameters:
pForceDFT
void icl::filter::IFFTOp::setJoinMatrix ( bool  pJoin)

Sets if two channels shall be joined to one complex.

Parameters:
pJointrue if channels shall be joined to one complex

Sets the resultmode.

Sets the roi.

Parameters:
roithe new roi

Sets the sizeadaptionmode.

Parameters:
samthe sizeadaptionmode to be set

Member Data Documentation

Data* icl::filter::IFFTOp::m_data [private]

Class for internal params and buffers.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines