Orfeo Toolbox  4.0
Classes | Public Types | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
itk::MultivariateLegendrePolynomial Class Reference

2D and 3D multivariate Legendre Polynomial More...

#include <itkMultivariateLegendrePolynomial.h>

+ Collaboration diagram for itk::MultivariateLegendrePolynomial:

Classes

class  CoefficientVectorSizeMismatch
 Exception object. More...
 
class  SimpleForwardIterator
 Iterator which only supports forward iteration and Begin(), IsAtEnd(), and Get() method which work just like as SimpleImageRegionIterator. More...
 

Public Types

typedef DoubleArrayType CoefficientArrayType
 
typedef ULongArrayType DomainSizeType
 
typedef std::vector< double > DoubleArrayType
 
typedef LongArrayType IndexType
 
typedef std::vector< long > LongArrayType
 
typedef Array< double > ParametersType
 
typedef
MultivariateLegendrePolynomial 
Self
 
typedef std::vector< unsigned
long > 
ULongArrayType
 

Public Member Functions

 MultivariateLegendrePolynomial (unsigned int dimension, unsigned int degree, const DomainSizeType &domainSize)
 
virtual ~MultivariateLegendrePolynomial ()
 
double Evaluate (IndexType &index)
 
const CoefficientArrayTypeGetCoefficients (void) const
 Gets Legendre polynomials' coefficients. More...
 
unsigned int GetDegree (void) const
 
unsigned int GetDimension (void) const
 
const DomainSizeTypeGetDomainSize (void) const
 
unsigned int GetNumberOfCoefficients (void) const
 
unsigned int GetNumberOfCoefficients ()
 
unsigned int GetNumberOfCoefficients (unsigned int dimension, unsigned int degree)
 
void Print (std::ostream &os)
 
void SetCoefficients (const CoefficientArrayType &coef) throw ( CoefficientVectorSizeMismatch )
 Sets the Legendre polynomials' parameters. More...
 
void SetCoefficients (const ParametersType &coef) throw ( CoefficientVectorSizeMismatch )
 

Protected Member Functions

void CalculateXCoef (double norm_y, const CoefficientArrayType &coef)
 
void CalculateYCoef (double norm_z, const CoefficientArrayType &coef)
 
double LegendreSum (const double x, int n, const CoefficientArrayType &coef, int offset=0)
 
void PrintSelf (std::ostream &os, Indent indent) const
 

Private Attributes

CoefficientArrayType m_CachedXCoef
 
CoefficientArrayType m_CachedYCoef
 
CoefficientArrayType m_CachedZCoef
 
CoefficientArrayType m_CoefficientArray
 
unsigned int m_Degree
 
unsigned int m_Dimension
 
DomainSizeType m_DomainSize
 
DoubleArrayType m_NormFactor
 
unsigned int m_NumberOfCoefficients
 
IndexValueType m_PrevY
 
IndexValueType m_PrevZ
 

Detailed Description

2D and 3D multivariate Legendre Polynomial

In 2D,

\[ f(x_{vector}, parameter_{vector}) = \sum_i^l \left( \sum_j^{l-i} \left( parameter_ {ij} * P_i(x) *P_j(y)) \right) \right) \]

where P_i() denoting a Legendre polynomial of degree i and l it the degree of the polynomial

In 3D,

\[ f(x_{vector}, parameter_{vector}) = \sum_i^l \left( \sum_j^{l-i} \left( \sum_k^{l-i-j} \left( parameter_{ijk} * P_i(x) * P_j(y) * P_k(z) \right) \right) \right) \]

The size of the parameter vector for 2D is $\frac{(l+1)\cdot(1+2)}{2}$, and for 3D is $\frac{(l+1)*(l+2)*(l+3)}{3!}$

To get the size of the parameter vector, users can use one of the two GetNumberOfCoefficients() member functions

To get function result, users can use the operator() or its SimpleForwardIterator's Get() method.

This is a part of the bias correction methods and implemenations that was initially developed and implemented by Martin Styner, Univ. of North Carolina at Chapel Hill, and his colleagues.

Note
For more details. refer to the following articles. "Parametric estimate of intensity inhomogeneities applied to MRI" Martin Styner, G. Gerig, Christian Brechbuehler, Gabor Szekely, IEEE TRANSACTIONS ON MEDICAL IMAGING; 19(3), pp. 153-165, 2000, (http://www.cs.unc.edu/~styner/docs/tmi99.pdf)

"Evaluation of 2D/3D bias correction with 1+1ES-optimization" Martin Styner, Prof. Dr. G. Gerig (IKT, BIWI, ETH Zuerich), TR-197 (http://www.cs.unc.edu/~styner/docs/StynerTR97.pdf)

Definition at line 74 of file itkMultivariateLegendrePolynomial.h.

Member Typedef Documentation

Internal coefficient storage type.

Definition at line 84 of file itkMultivariateLegendrePolynomial.h.

The size of the domain.

Definition at line 91 of file itkMultivariateLegendrePolynomial.h.

Definition at line 79 of file itkMultivariateLegendrePolynomial.h.

Definition at line 92 of file itkMultivariateLegendrePolynomial.h.

Definition at line 81 of file itkMultivariateLegendrePolynomial.h.

Same as CoefficientArray This type definition will be used by EnergyFunction object.

Definition at line 88 of file itkMultivariateLegendrePolynomial.h.

Definition at line 77 of file itkMultivariateLegendrePolynomial.h.

typedef std::vector< unsigned long > itk::MultivariateLegendrePolynomial::ULongArrayType

Definition at line 80 of file itkMultivariateLegendrePolynomial.h.

Constructor & Destructor Documentation

itk::MultivariateLegendrePolynomial::MultivariateLegendrePolynomial ( unsigned int  dimension,
unsigned int  degree,
const DomainSizeType domainSize 
)

Constructor.

Definition at line 24 of file itkMultivariateLegendrePolynomial.cxx.

itk::MultivariateLegendrePolynomial::~MultivariateLegendrePolynomial ( )
virtual

Destructor.

Definition at line 62 of file itkMultivariateLegendrePolynomial.cxx.

Member Function Documentation

void itk::MultivariateLegendrePolynomial::CalculateXCoef ( double  norm_y,
const CoefficientArrayType coef 
)
protected

Definition at line 178 of file itkMultivariateLegendrePolynomial.cxx.

Referenced by Evaluate().

void itk::MultivariateLegendrePolynomial::CalculateYCoef ( double  norm_z,
const CoefficientArrayType coef 
)
protected

Definition at line 193 of file itkMultivariateLegendrePolynomial.cxx.

Referenced by Evaluate().

double itk::MultivariateLegendrePolynomial::Evaluate ( IndexType index)
inline

In the case which the bias field is 2D, it returns bias value at the point which is specified by the index

Definition at line 154 of file itkMultivariateLegendrePolynomial.h.

References CalculateXCoef(), CalculateYCoef(), LegendreSum(), m_CachedXCoef, m_CachedYCoef, m_CoefficientArray, m_Degree, m_Dimension, m_NormFactor, m_PrevY, and m_PrevZ.

Referenced by itk::MultivariateLegendrePolynomial::SimpleForwardIterator::Get().

const MultivariateLegendrePolynomial::CoefficientArrayType & itk::MultivariateLegendrePolynomial::GetCoefficients ( void  ) const
unsigned int itk::MultivariateLegendrePolynomial::GetDegree ( void  ) const
inline

Gets the degree (the degree of Legendre polynomials).

Definition at line 106 of file itkMultivariateLegendrePolynomial.h.

References m_Degree.

unsigned int itk::MultivariateLegendrePolynomial::GetDimension ( void  ) const
inline
const DomainSizeType& itk::MultivariateLegendrePolynomial::GetDomainSize ( void  ) const
inline
unsigned int itk::MultivariateLegendrePolynomial::GetNumberOfCoefficients ( void  ) const
inline

Returns the number of coefficients of the polynomial This number is computed from the degree of the polynomial the SetCoefficients() method expects an array of this size, an exception is thrown otherwise

See Also
SetCoefficients

Definition at line 115 of file itkMultivariateLegendrePolynomial.h.

References m_NumberOfCoefficients.

Referenced by itk::MRIBiasFieldCorrectionFilter< TInputImage, TOutputImage, TMaskImage >::GenerateData().

unsigned int itk::MultivariateLegendrePolynomial::GetNumberOfCoefficients ( )

Gets the number of coefficients.

unsigned int itk::MultivariateLegendrePolynomial::GetNumberOfCoefficients ( unsigned int  dimension,
unsigned int  degree 
)

Gets the number of coefficients.

Definition at line 240 of file itkMultivariateLegendrePolynomial.cxx.

double itk::MultivariateLegendrePolynomial::LegendreSum ( const double  x,
int  n,
const CoefficientArrayType coef,
int  offset = 0 
)
protected

Definition at line 219 of file itkMultivariateLegendrePolynomial.cxx.

Referenced by Evaluate().

void itk::MultivariateLegendrePolynomial::Print ( std::ostream &  os)

Definition at line 66 of file itkMultivariateLegendrePolynomial.cxx.

Referenced by itk::operator<<().

void itk::MultivariateLegendrePolynomial::PrintSelf ( std::ostream &  os,
Indent  indent 
) const
protected

Definition at line 74 of file itkMultivariateLegendrePolynomial.cxx.

void itk::MultivariateLegendrePolynomial::SetCoefficients ( const CoefficientArrayType coef) throw ( CoefficientVectorSizeMismatch )

Sets the Legendre polynomials' parameters.

Warning
The number of coefficients provided should match the number returned by GetNumberOfCoefficients() otherwise an exception is thrown.

Definition at line 125 of file itkMultivariateLegendrePolynomial.cxx.

Referenced by itk::MRIBiasFieldCorrectionFilter< TInputImage, TOutputImage, TMaskImage >::EstimateBiasField().

void itk::MultivariateLegendrePolynomial::SetCoefficients ( const ParametersType coef) throw ( CoefficientVectorSizeMismatch )

Definition at line 148 of file itkMultivariateLegendrePolynomial.cxx.

Member Data Documentation

CoefficientArrayType itk::MultivariateLegendrePolynomial::m_CachedXCoef
private

Definition at line 293 of file itkMultivariateLegendrePolynomial.h.

Referenced by Evaluate().

CoefficientArrayType itk::MultivariateLegendrePolynomial::m_CachedYCoef
private

Definition at line 294 of file itkMultivariateLegendrePolynomial.h.

Referenced by Evaluate().

CoefficientArrayType itk::MultivariateLegendrePolynomial::m_CachedZCoef
private

Definition at line 295 of file itkMultivariateLegendrePolynomial.h.

CoefficientArrayType itk::MultivariateLegendrePolynomial::m_CoefficientArray
private

Definition at line 292 of file itkMultivariateLegendrePolynomial.h.

Referenced by Evaluate().

unsigned int itk::MultivariateLegendrePolynomial::m_Degree
private

Definition at line 289 of file itkMultivariateLegendrePolynomial.h.

Referenced by Evaluate(), and GetDegree().

unsigned int itk::MultivariateLegendrePolynomial::m_Dimension
private

Definition at line 288 of file itkMultivariateLegendrePolynomial.h.

Referenced by Evaluate(), and GetDimension().

DomainSizeType itk::MultivariateLegendrePolynomial::m_DomainSize
private

Definition at line 287 of file itkMultivariateLegendrePolynomial.h.

Referenced by GetDomainSize().

DoubleArrayType itk::MultivariateLegendrePolynomial::m_NormFactor
private

Definition at line 297 of file itkMultivariateLegendrePolynomial.h.

Referenced by Evaluate().

unsigned int itk::MultivariateLegendrePolynomial::m_NumberOfCoefficients
private

Definition at line 290 of file itkMultivariateLegendrePolynomial.h.

Referenced by GetNumberOfCoefficients().

IndexValueType itk::MultivariateLegendrePolynomial::m_PrevY
private

Definition at line 298 of file itkMultivariateLegendrePolynomial.h.

Referenced by Evaluate().

IndexValueType itk::MultivariateLegendrePolynomial::m_PrevZ
private

Definition at line 299 of file itkMultivariateLegendrePolynomial.h.

Referenced by Evaluate().


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

Generated at Sat Mar 8 2014 17:29:09 for Orfeo Toolbox with doxygen 1.8.3.1