STIRA  0.1
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
stira::steerable::PyramidMaster< T > Class Template Referenceabstract

parent class to compute FFT based real- and complex-valued steerable pyramids (decomposition/reconstruction) More...

#include <PyramidMaster.h>

Public Member Functions

 PyramidMaster (ArrayGrid< double > *pGridIn, int myNrScales, int myNrOrientations)
 constructor More...
 
virtual ~PyramidMaster ()
 destructor More...
 
virtual bool Decompose ()=0
 decomposes the source image in an steerable pyramid
 
virtual bool Reconstruct ()=0
 reconstructs the steerable pyramid back to an image
 
virtual bool Diagnose ()=0
 diagnoses the current steerable pyramid
 
fouriertools::FFTBandSumFFTBands (std::vector< fouriertools::FFTBand * > fftSubbandSet)
 calculates the sum over a set of FFTBands creates a new FFTBand that becomes the responsability of the caller to delete More...
 
ArrayGrid< double > * GetCopyOfReconstructedGrid ()
 creates a copy of the grid after reconstruction This becomes the responsability of the caller to delete; the local member which contains the reconstructed grid is then deleted by the destructor of this class More...
 
Pyramid< T > * GetPyramid ()
 gets a pointer to the actual pyramid data
 
void SetPyramid (Pyramid< T > *pPyramid)
 sets a pointer to new pyramid data if old data exists already, they are deleted first More...
 

Protected Member Functions

ArrayGrid< double > * ExtractL0 ()
 extracts the first L0 band
 
fouriertools::FFTBandExtractB0 (common::NumberMode myMode)
 extracts a B0 band with given orientation index More...
 
ArrayGrid< double > * ExtractL ()
 extracts recursive L band
 
fouriertools::FFTBandExtractB (common::NumberMode myMode)
 extracts a B band with given orientation index More...
 
fouriertools::FFTBandReconstructL0 (std::vector< fouriertools::FFTBand * > vpFFTBandSet)
 reconstructs the first L0 band Output is still in Fourier domain to save FFT's More...
 
fouriertools::FFTBandReconstructB0 (ArrayGrid< T > *pGridIn, common::NumberMode myMode)
 reconstructs a B0 band with given orientation index Output is still in Fourier domain to save FFT's More...
 
fouriertools::FFTBandReconstructL (ArrayGrid< double > *pGridIn)
 reconstructs L band Output is still in Fourier domain to save FFT's More...
 
fouriertools::FFTBandReconstructB (ArrayGrid< T > *pGridIn, common::NumberMode myMode)
 reconstructs a B0 band with given orientation index Output is still in Fourier domain to save FFT's More...
 
ArrayGrid< double > * MergeAndReconstructFFTBands (std::vector< fouriertools::FFTBand * > fftSubbandSet)
 computes sum, followed by inverse Fourier Transform More...
 
void ClearFFTVector (std::vector< fouriertools::FFTBand * > &set)
 clears an STL vector with FFTBands also deletes elements in the vector More...
 
void SetFFTBand (fouriertools::FFTBand *pFFTBand)
 sets current input FFTBand For computational efficiency, we compute the FFT of the input grid for a scale just once and keep this to extract the different bands from it More...
 
fouriertools::FFTBandGetFFTBand ()
 gets current input FFTBand For computational efficiency, we compute the FFT of the input grid for a scale just once and keep this to extract the different bands from it
 
void CleanFFTBand ()
 cleans current input FFTBand Also sets its pointer to 0
 
bool ViewTransferFunction (fouriertools::FFTBand *pTransferFunction, std::string token, int scale, int orientation, int maxNrOfOrientations, bool isForward)
 Writes a transfer function to PGM for diagnostics. More...
 

Protected Attributes

Pyramid< T > * mpPyramid
 the pyramid bands
 
ArrayGrid< double > * mpSourceGrid
 the source data grid
 
ArrayGrid< double > * mpReconstructedGrid
 the data grid after reconstruction
 
int mNrScales
 nr of scales in the pyramid
 
int mNrOrientations
 nr of orientations (in paper called K) per scale in the pyramid
 
int mWidth
 width of the source image
 
int mHeight
 height of the source image
 
bool mIsForwardTransform
 flag if we are computing the forward transform
 
ArrayGrid< double > * mpTmpHighpassGrid
 tmp member in order to avoid recomputation of this transfer function for each oriented subband
 
std::complex< double > mDecompositionFactor
 modulation factor for oriented bands (-i)^(K-1) during decomposition
 
std::complex< double > mReconstructionFactor
 modulation factor for oriented bands (-i)^(K-1) during reconstruction
 
fouriertools::FFTBandmpFFTBand
 FFT of the input grid for a scale.
 
int mCurrentScale
 current scale we are at (while decomposing or reconstructing)
 
int mCurrentOrientation
 current orientation within current scale we are at (while decomposing or reconstructing)
 

Detailed Description

template<class T>
class stira::steerable::PyramidMaster< T >

parent class to compute FFT based real- and complex-valued steerable pyramids (decomposition/reconstruction)

Constructor & Destructor Documentation

template<class T >
stira::steerable::PyramidMaster< T >::PyramidMaster ( ArrayGrid< double > *  pGridIn,
int  myNrScales,
int  myNrOrientations 
)

constructor

Parameters
pGridInsource input grid data
myNrScalesnr of scales in which to decompose the image
myNrOrientationsnr of orientations in which to decompose the image

References stira::imagedata::ArrayGrid< T >::GetWidth().

template<class T >
stira::steerable::PyramidMaster< T >::~PyramidMaster ( )
virtual

destructor

Warning
: also deletes the mpPyramid data structure with all the subbands Make sure you do not use the data structure you obtained with GetPyramid() after this point!!!

Member Function Documentation

template<class T >
void stira::steerable::PyramidMaster< T >::ClearFFTVector ( std::vector< fouriertools::FFTBand * > &  set)
protected

clears an STL vector with FFTBands also deletes elements in the vector

Parameters
setSTL vector with FFTBands to clean
template<class T >
fouriertools::FFTBand * stira::steerable::PyramidMaster< T >::ExtractB ( common::NumberMode  myMode)
protected
template<class T >
fouriertools::FFTBand * stira::steerable::PyramidMaster< T >::ExtractB0 ( common::NumberMode  myMode)
protected
template<class T >
ArrayGrid< double > * stira::steerable::PyramidMaster< T >::GetCopyOfReconstructedGrid ( )

creates a copy of the grid after reconstruction This becomes the responsability of the caller to delete; the local member which contains the reconstructed grid is then deleted by the destructor of this class

In case no grid is available, 0 is returned.

References stira::imagedata::ArrayGrid< T >::Clone().

Referenced by stira::deconvolve::GNCDeconvolve::Run().

template<class T >
ArrayGrid< double > * stira::steerable::PyramidMaster< T >::MergeAndReconstructFFTBands ( std::vector< fouriertools::FFTBand * >  fftSubbandSet)
protected

computes sum, followed by inverse Fourier Transform

Parameters
fftSubbandSetstl vector with FFTBands to merge

References stira::fouriertools::FFTBand::ApplyInverseTransform(), stira::fouriertools::FFTBand::ConvertToRealGrid(), and stira::fouriertools::FFTBand::SwitchQuadrants().

template<class T>
fouriertools::FFTBand * stira::steerable::PyramidMaster< T >::ReconstructB ( ArrayGrid< T > *  pGridIn,
common::NumberMode  myMode 
)
protected

reconstructs a B0 band with given orientation index Output is still in Fourier domain to save FFT's

Parameters
pGridIninput B0 band (spatial domain)
myModeindicates whether we deal with real-valued or complex-values pyramid

References stira::fouriertools::FFT::ApplyTransferFunctionFFT(), stira::fouriertools::TransferFunctionGenerator::GenerateOrientedTransferFunction(), stira::imagedata::ArrayGrid< T >::GetHeight(), stira::imagedata::ArrayGrid< T >::GetWidth(), and stira::fouriertools::FFTBand::Multiply().

template<class T>
fouriertools::FFTBand * stira::steerable::PyramidMaster< T >::ReconstructB0 ( ArrayGrid< T > *  pGridIn,
common::NumberMode  myMode 
)
protected

reconstructs a B0 band with given orientation index Output is still in Fourier domain to save FFT's

Parameters
pGridIninput B0 band (spatial domain)
myModeindicates whether we deal with real-valued or complex-values pyramid

References stira::fouriertools::FFT::ApplyTransferFunctionFFT(), stira::fouriertools::TransferFunctionGenerator::GenerateOrientedTransferFunction(), stira::imagedata::ArrayGrid< T >::GetHeight(), stira::imagedata::ArrayGrid< T >::GetWidth(), stira::fouriertools::TransferFunctionGenerator::HighFrequencyCrossMask(), and stira::fouriertools::FFTBand::Multiply().

template<class T >
fouriertools::FFTBand * stira::steerable::PyramidMaster< T >::ReconstructL ( ArrayGrid< double > *  pGridIn)
protected
template<class T >
fouriertools::FFTBand * stira::steerable::PyramidMaster< T >::ReconstructL0 ( std::vector< fouriertools::FFTBand * >  vpFFTBandSet)
protected

reconstructs the first L0 band Output is still in Fourier domain to save FFT's

Parameters
vpFFTBandSetset of input bands (already in Fourier domain)

References stira::fouriertools::TransferFunctionGenerator::GenerateLowPassTransferFunction(), stira::fouriertools::FFTBand::GetHeight(), stira::fouriertools::FFTBand::GetWidth(), and stira::fouriertools::FFTBand::Multiply().

template<class T >
void stira::steerable::PyramidMaster< T >::SetFFTBand ( fouriertools::FFTBand pFFTBand)
protected

sets current input FFTBand For computational efficiency, we compute the FFT of the input grid for a scale just once and keep this to extract the different bands from it

Parameters
pFFTBandthe input FFTBand
template<class T>
void stira::steerable::PyramidMaster< T >::SetPyramid ( Pyramid< T > *  pPyramid)

sets a pointer to new pyramid data if old data exists already, they are deleted first

Warning
: destructor of this class will also deletes the mpPyramid data structure with all the subbands Make sure you do not use the data structure you are setting here after this destructor is called!!!
Parameters
pPyramidpointer to new pyramid data
template<class T >
fouriertools::FFTBand * stira::steerable::PyramidMaster< T >::SumFFTBands ( std::vector< fouriertools::FFTBand * >  fftSubbandSet)

calculates the sum over a set of FFTBands creates a new FFTBand that becomes the responsability of the caller to delete

Parameters
fftSubbandSetstl vector with FFTBands to sum

References stira::fouriertools::FFTBand::GetHeight(), and stira::fouriertools::FFTBand::SetValue().

template<class T >
bool stira::steerable::PyramidMaster< T >::ViewTransferFunction ( fouriertools::FFTBand pTransferFunction,
std::string  token,
int  scale,
int  orientation,
int  maxNrOfOrientations,
bool  isForward 
)
protected

Writes a transfer function to PGM for diagnostics.

Parameters
pTransferFunctiontransfer function to be visualized
tokenfile name token
scalenumber of scale to be incorporated in file name
orientationnumber of orientation to be incorporated in file name
maxNrOfOrientationsmax number of orientations, needed to make grid real-valued again
isForwardflag if transfer function is in forward or backward transform, needed to make grid real-valued again
Returns
true if all went well

References stira::fouriertools::FFTBand::GetHeight(), stira::fouriertools::FFTBand::GetValue(), stira::fouriertools::FFTBand::GetWidth(), stira::imagetools::ImageIO::GRADIENT_OUT, stira::imagedata::ArrayGrid< T >::SetValue(), and stira::imagetools::ImageIO::WritePGM().


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