ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itk::MultivariateLegendrePolynomial Class Reference

#include <itkMultivariateLegendrePolynomial.h>

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 implementations 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 [113] and [112].

Definition at line 69 of file itkMultivariateLegendrePolynomial.h.

+ Collaboration diagram for itk::MultivariateLegendrePolynomial:

Classes

class  CoefficientVectorSizeMismatch
 
class  SimpleForwardIterator
 

Public Types

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

Public Member Functions

const CoefficientArrayTypeGetCoefficients () const
 
unsigned int GetDegree () const
 
unsigned int GetDimension () const
 
const DomainSizeTypeGetDomainSize () const
 
unsigned int GetNumberOfCoefficients () const
 
unsigned int GetNumberOfCoefficients (unsigned int dimension, unsigned int degree)
 
 MultivariateLegendrePolynomial (unsigned int dimension, unsigned int degree, const DomainSizeType &domainSize)
 
void Print (std::ostream &os) const
 
void SetCoefficients (const CoefficientArrayType &coefficients)
 
void SetCoefficients (const ParametersType &coefficients)
 
virtual ~MultivariateLegendrePolynomial ()
 
double Evaluate (IndexType &index)
 

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 {}
 

Member Typedef Documentation

◆ CoefficientArrayType

Internal coefficient storage type.

Definition at line 79 of file itkMultivariateLegendrePolynomial.h.

◆ DomainSizeType

◆ DoubleArrayType

Definition at line 74 of file itkMultivariateLegendrePolynomial.h.

◆ IndexType

◆ LongArrayType

Definition at line 76 of file itkMultivariateLegendrePolynomial.h.

◆ ParametersType

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

Definition at line 83 of file itkMultivariateLegendrePolynomial.h.

◆ Self

◆ ULongArrayType

using itk::MultivariateLegendrePolynomial::ULongArrayType = std::vector<unsigned long>

Definition at line 75 of file itkMultivariateLegendrePolynomial.h.

Constructor & Destructor Documentation

◆ MultivariateLegendrePolynomial()

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

◆ ~MultivariateLegendrePolynomial()

virtual itk::MultivariateLegendrePolynomial::~MultivariateLegendrePolynomial ( )
virtual

Destructor.

Member Function Documentation

◆ CalculateXCoef()

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

Referenced by Evaluate().

◆ CalculateYCoef()

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

Referenced by Evaluate().

◆ 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 162 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.

◆ GetCoefficients()

const CoefficientArrayType & itk::MultivariateLegendrePolynomial::GetCoefficients ( ) const

Gets Legendre polynomials' coefficients.

◆ GetDegree()

unsigned int itk::MultivariateLegendrePolynomial::GetDegree ( ) const
inline

Gets the degree (the degree of Legendre polynomials).

Definition at line 104 of file itkMultivariateLegendrePolynomial.h.

References m_Degree.

◆ GetDimension()

unsigned int itk::MultivariateLegendrePolynomial::GetDimension ( ) const
inline

◆ GetDomainSize()

const DomainSizeType & itk::MultivariateLegendrePolynomial::GetDomainSize ( ) const
inline

◆ GetNumberOfCoefficients() [1/2]

unsigned int itk::MultivariateLegendrePolynomial::GetNumberOfCoefficients ( ) 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 116 of file itkMultivariateLegendrePolynomial.h.

References m_NumberOfCoefficients.

◆ GetNumberOfCoefficients() [2/2]

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

Gets the number of coefficients.

◆ LegendreSum()

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

Referenced by Evaluate().

◆ Print()

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

◆ PrintSelf()

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

◆ SetCoefficients() [1/2]

void itk::MultivariateLegendrePolynomial::SetCoefficients ( const CoefficientArrayType & coefficients)

Sets the Legendre polynomials' parameters.

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

◆ SetCoefficients() [2/2]

void itk::MultivariateLegendrePolynomial::SetCoefficients ( const ParametersType & coefficients)

Member Data Documentation

◆ m_CachedXCoef

CoefficientArrayType itk::MultivariateLegendrePolynomial::m_CachedXCoef {}
private

Definition at line 306 of file itkMultivariateLegendrePolynomial.h.

Referenced by Evaluate().

◆ m_CachedYCoef

CoefficientArrayType itk::MultivariateLegendrePolynomial::m_CachedYCoef {}
private

Definition at line 307 of file itkMultivariateLegendrePolynomial.h.

Referenced by Evaluate().

◆ m_CachedZCoef

CoefficientArrayType itk::MultivariateLegendrePolynomial::m_CachedZCoef {}
private

Definition at line 308 of file itkMultivariateLegendrePolynomial.h.

◆ m_CoefficientArray

CoefficientArrayType itk::MultivariateLegendrePolynomial::m_CoefficientArray {}
private

Definition at line 305 of file itkMultivariateLegendrePolynomial.h.

Referenced by Evaluate().

◆ m_Degree

unsigned int itk::MultivariateLegendrePolynomial::m_Degree {}
private

Definition at line 302 of file itkMultivariateLegendrePolynomial.h.

Referenced by Evaluate(), and GetDegree().

◆ m_Dimension

unsigned int itk::MultivariateLegendrePolynomial::m_Dimension {}
private

Definition at line 301 of file itkMultivariateLegendrePolynomial.h.

Referenced by Evaluate(), and GetDimension().

◆ m_DomainSize

DomainSizeType itk::MultivariateLegendrePolynomial::m_DomainSize {}
private

Definition at line 300 of file itkMultivariateLegendrePolynomial.h.

Referenced by GetDomainSize().

◆ m_NormFactor

DoubleArrayType itk::MultivariateLegendrePolynomial::m_NormFactor {}
private

Definition at line 310 of file itkMultivariateLegendrePolynomial.h.

Referenced by Evaluate().

◆ m_NumberOfCoefficients

unsigned int itk::MultivariateLegendrePolynomial::m_NumberOfCoefficients {}
private

Definition at line 303 of file itkMultivariateLegendrePolynomial.h.

Referenced by GetNumberOfCoefficients().

◆ m_PrevY

IndexValueType itk::MultivariateLegendrePolynomial::m_PrevY {}
private

Definition at line 311 of file itkMultivariateLegendrePolynomial.h.

Referenced by Evaluate().

◆ m_PrevZ

IndexValueType itk::MultivariateLegendrePolynomial::m_PrevZ {}
private

Definition at line 312 of file itkMultivariateLegendrePolynomial.h.

Referenced by Evaluate().


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