Public Types | Public Member Functions | Static Public Attributes | Protected Attributes | Private Member Functions | Static Private Member Functions | Private Attributes

cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul > Class Template Reference
[cmtkSegmentation Library]

Functional to correct MR intensity bias by miniming image entropy. More...

#include <cmtkEntropyMinimizationIntensityCorrectionFunctional.h>

Inheritance diagram for cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul >:
Inheritance graph
[legend]
Collaboration diagram for cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef
EntropyMinimizationIntensityCorrectionFunctional
< NOrderAdd, NOrderMul > 
Self
 This class type.
typedef SmartPointer< SelfSmartPtr
 Pointer to this class.
typedef
EntropyMinimizationIntensityCorrectionFunctionalBase 
Superclass
 Superclass type.
typedef Polynomial< NOrderAdd,
Types::Coordinate
PolynomialTypeAdd
 Additive correction polynomial.
typedef Polynomial< NOrderMul,
Types::Coordinate
PolynomialTypeMul
 Multiplicative correction polynomial.

Public Member Functions

 EntropyMinimizationIntensityCorrectionFunctional ()
 Constructor.
virtual ~EntropyMinimizationIntensityCorrectionFunctional ()
 Virtual destructor.
virtual size_t ParamVectorDim () const
 Return parameter vector length.
virtual Types::Coordinate GetParamStep (const size_t idx, const Types::Coordinate mmStep=1) const
 Return parameter stepping.
virtual size_t GetNumberOfMonomialsAdd () const
 Get number of additive monomials.
virtual size_t GetNumberOfMonomialsMul () const
 Get number of multiplicative monomials.
virtual void SetParamVector (CoordinateVector &v)
 Copy parameters to the two correction polynomials.
virtual void GetParamVector (CoordinateVector &v)
 Extract parameter vector from the two correction polynomials.
virtual Self::ReturnType EvaluateWithGradient (CoordinateVector &v, CoordinateVector &g, const Types::Coordinate step)
 Fast implementation of gradient evaluation.

Static Public Attributes

static const size_t m_NumberOfParameters = PolynomialTypeAdd::NumberOfMonomials + PolynomialTypeMul::NumberOfMonomials
 Total number of parameters is number of additive plus number of multiplicative parameters.

Protected Attributes

CoordinateVector m_ParameterVector
 Keep a copy of the current parameter vector.
Types::Coordinate m_StepSizeAdd [1+PolynomialTypeAdd::NumberOfMonomials]
 Additive correction term coefficients.
Types::Coordinate m_StepSizeMul [1+PolynomialTypeMul::NumberOfMonomials]
 Multiplicative correction term coefficients.
Types::Coordinate m_CoefficientsAdd [1+PolynomialTypeAdd::NumberOfMonomials]
 Additive correction term coefficients.
Types::Coordinate m_CoefficientsMul [1+PolynomialTypeMul::NumberOfMonomials]
 Multiplicative correction term coefficients.
Types::Coordinate m_AddCorrectionAdd [1+PolynomialTypeAdd::NumberOfMonomials]
 Additive correction constants for additive polynomials.
Types::Coordinate m_MulCorrectionAdd [1+PolynomialTypeAdd::NumberOfMonomials]
 Multiplicative correction constants for additive polynomials.
Types::Coordinate m_AddCorrectionMul [1+PolynomialTypeMul::NumberOfMonomials]
 Additive correction constants for multiplicative polynomials.
Types::Coordinate m_MulCorrectionMul [1+PolynomialTypeMul::NumberOfMonomials]
 Multiplicative correction constants for additive polynomials.

Private Member Functions

virtual void UpdateCorrectionFactors ()
 Update polynomial correctionfactors from input image.
virtual void UpdateBiasFields (const bool foregroundOnly=true)
 Jointly update both bias images.
virtual void UpdateBiasFieldAdd (const bool foregroundOnly=true)
 Update additive bias image.
virtual void UpdateBiasFieldMul (const bool foregroundOnly=true)
 Update multiplicative bias image.

Static Private Member Functions

static void UpdateBiasFieldsThreadFunc (void *args, const size_t taskIdx, const size_t taskCnt, const size_t threadIdx, const size_t)
 Thread function: jointly update both bias images.
static void UpdateBiasFieldsAllThreadFunc (void *args, const size_t taskIdx, const size_t taskCnt, const size_t threadIdx, const size_t)
 Thread function: jointly update both bias images.
static void UpdateBiasFieldAddThreadFunc (void *args, const size_t taskIdx, const size_t taskCnt, const size_t threadIdx, const size_t)
 Thread function: update foreground additive bias images.
static void UpdateBiasFieldAddAllThreadFunc (void *args, const size_t taskIdx, const size_t taskCnt, const size_t threadIdx, const size_t)
 Thread function: update complete additive bias images.
static void UpdateBiasFieldMulThreadFunc (void *args, const size_t taskIdx, const size_t taskCnt, const size_t threadIdx, const size_t)
 Thread function: update foreground multiplicative bias images.
static void UpdateBiasFieldMulAllThreadFunc (void *args, const size_t taskIdx, const size_t taskCnt, const size_t threadIdx, const size_t)
 Thread function: update complete multiplicative bias images.

Private Attributes

size_t m_NumberOfThreads
 Number of parallel threads.
size_t m_MonomialsPerThread
 Maximum number of monomials per thread (maximum of additive and multiplicative polynomial number of monomials).
Types::Coordinatem_MonomialsVec
 Temporary storage for evaluating monomials.

Detailed Description

template<unsigned int NOrderAdd, unsigned int NOrderMul>
class cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul >

Functional to correct MR intensity bias by miniming image entropy.

Definition at line 56 of file cmtkEntropyMinimizationIntensityCorrectionFunctional.h.


Member Typedef Documentation

template<unsigned int NOrderAdd, unsigned int NOrderMul>
typedef Polynomial<NOrderAdd,Types::Coordinate> cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul >::PolynomialTypeAdd

Additive correction polynomial.

Definition at line 71 of file cmtkEntropyMinimizationIntensityCorrectionFunctional.h.

template<unsigned int NOrderAdd, unsigned int NOrderMul>
typedef Polynomial<NOrderMul,Types::Coordinate> cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul >::PolynomialTypeMul

Multiplicative correction polynomial.

Definition at line 74 of file cmtkEntropyMinimizationIntensityCorrectionFunctional.h.

template<unsigned int NOrderAdd, unsigned int NOrderMul>
typedef EntropyMinimizationIntensityCorrectionFunctional<NOrderAdd,NOrderMul> cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul >::Self
template<unsigned int NOrderAdd, unsigned int NOrderMul>
typedef SmartPointer<Self> cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul >::SmartPtr
template<unsigned int NOrderAdd, unsigned int NOrderMul>
typedef EntropyMinimizationIntensityCorrectionFunctionalBase cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul >::Superclass

Constructor & Destructor Documentation

template<unsigned int NOrderAdd, unsigned int NOrderMul>
cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul >::EntropyMinimizationIntensityCorrectionFunctional (  ) [inline]
template<unsigned int NOrderAdd, unsigned int NOrderMul>
virtual cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul >::~EntropyMinimizationIntensityCorrectionFunctional (  ) [inline, virtual]

Virtual destructor.

Definition at line 89 of file cmtkEntropyMinimizationIntensityCorrectionFunctional.h.

References cmtk::Memory::DeleteArray().


Member Function Documentation

template<unsigned int NOrderAdd, unsigned int NOrderMul>
cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul >::ReturnType cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul >::EvaluateWithGradient ( CoordinateVector v,
CoordinateVector g,
const Types::Coordinate  step 
) [virtual]

Fast implementation of gradient evaluation.

This function only updates either the additive of the multiplicative bias field, depending on which gradient component is being determined.

Reimplemented in cmtk::EntropyMinimizationIntensityCorrectionFunctionalDevice< NOrderAdd, NOrderMul >.

Definition at line 224 of file cmtkEntropyMinimizationIntensityCorrectionFunctional.txx.

template<unsigned int NOrderAdd, unsigned int NOrderMul>
virtual size_t cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul >::GetNumberOfMonomialsAdd (  ) const [inline, virtual]

Get number of additive monomials.

Implements cmtk::EntropyMinimizationIntensityCorrectionFunctionalBase.

Definition at line 114 of file cmtkEntropyMinimizationIntensityCorrectionFunctional.h.

template<unsigned int NOrderAdd, unsigned int NOrderMul>
virtual size_t cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul >::GetNumberOfMonomialsMul (  ) const [inline, virtual]

Get number of multiplicative monomials.

Implements cmtk::EntropyMinimizationIntensityCorrectionFunctionalBase.

Definition at line 120 of file cmtkEntropyMinimizationIntensityCorrectionFunctional.h.

template<unsigned int NOrderAdd, unsigned int NOrderMul>
virtual Types::Coordinate cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul >::GetParamStep ( const size_t  idx,
const Types::Coordinate  mmStep = 1 
) const [inline, virtual]

Return parameter stepping.

Reimplemented from cmtk::Functional.

Definition at line 105 of file cmtkEntropyMinimizationIntensityCorrectionFunctional.h.

template<unsigned int NOrderAdd, unsigned int NOrderMul>
virtual void cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul >::GetParamVector ( CoordinateVector v ) [inline, virtual]

Extract parameter vector from the two correction polynomials.

Definition at line 138 of file cmtkEntropyMinimizationIntensityCorrectionFunctional.h.

template<unsigned int NOrderAdd, unsigned int NOrderMul>
virtual size_t cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul >::ParamVectorDim (  ) const [inline, virtual]

Return parameter vector length.

Implements cmtk::Functional.

Definition at line 98 of file cmtkEntropyMinimizationIntensityCorrectionFunctional.h.

template<unsigned int NOrderAdd, unsigned int NOrderMul>
virtual void cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul >::SetParamVector ( CoordinateVector v ) [inline, virtual]

Copy parameters to the two correction polynomials.

Definition at line 126 of file cmtkEntropyMinimizationIntensityCorrectionFunctional.h.

template<unsigned int NOrderAdd, unsigned int NOrderMul>
void cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul >::UpdateBiasFieldAdd ( const bool  foregroundOnly = true ) [private, virtual]
template<unsigned int NOrderAdd, unsigned int NOrderMul>
void cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul >::UpdateBiasFieldAddAllThreadFunc ( void *  args,
const size_t  taskIdx,
const size_t  taskCnt,
const size_t  threadIdx,
const   size_t 
) [static, private]

Thread function: update complete additive bias images.

Definition at line 489 of file cmtkEntropyMinimizationIntensityCorrectionFunctional.txx.

References cmtk::DataGrid::GetDataAt(), and cmtk::ThreadParameters< T >::thisObject.

template<unsigned int NOrderAdd, unsigned int NOrderMul>
void cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul >::UpdateBiasFieldAddThreadFunc ( void *  args,
const size_t  taskIdx,
const size_t  taskCnt,
const size_t  threadIdx,
const   size_t 
) [static, private]

Thread function: update foreground additive bias images.

Definition at line 436 of file cmtkEntropyMinimizationIntensityCorrectionFunctional.txx.

References cmtk::DataGrid::GetDataAt(), and cmtk::ThreadParameters< T >::thisObject.

template<unsigned int NOrderAdd, unsigned int NOrderMul>
void cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul >::UpdateBiasFieldMul ( const bool  foregroundOnly = true ) [private, virtual]
template<unsigned int NOrderAdd, unsigned int NOrderMul>
void cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul >::UpdateBiasFieldMulAllThreadFunc ( void *  args,
const size_t  taskIdx,
const size_t  taskCnt,
const size_t  threadIdx,
const   size_t 
) [static, private]

Thread function: update complete multiplicative bias images.

Definition at line 612 of file cmtkEntropyMinimizationIntensityCorrectionFunctional.txx.

References cmtk::DataGrid::GetDataAt(), and cmtk::ThreadParameters< T >::thisObject.

template<unsigned int NOrderAdd, unsigned int NOrderMul>
void cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul >::UpdateBiasFieldMulThreadFunc ( void *  args,
const size_t  taskIdx,
const size_t  taskCnt,
const size_t  threadIdx,
const   size_t 
) [static, private]

Thread function: update foreground multiplicative bias images.

Definition at line 559 of file cmtkEntropyMinimizationIntensityCorrectionFunctional.txx.

References cmtk::DataGrid::GetDataAt(), and cmtk::ThreadParameters< T >::thisObject.

template<unsigned int NOrderAdd, unsigned int NOrderMul>
void cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul >::UpdateBiasFields ( const bool  foregroundOnly = true ) [private, virtual]
template<unsigned int NOrderAdd, unsigned int NOrderMul>
void cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul >::UpdateBiasFieldsAllThreadFunc ( void *  args,
const size_t  taskIdx,
const size_t  taskCnt,
const size_t  threadIdx,
const   size_t 
) [static, private]

Thread function: jointly update both bias images.

Definition at line 357 of file cmtkEntropyMinimizationIntensityCorrectionFunctional.txx.

References cmtk::DataGrid::GetDataAt(), and cmtk::ThreadParameters< T >::thisObject.

template<unsigned int NOrderAdd, unsigned int NOrderMul>
void cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul >::UpdateBiasFieldsThreadFunc ( void *  args,
const size_t  taskIdx,
const size_t  taskCnt,
const size_t  threadIdx,
const   size_t 
) [static, private]

Thread function: jointly update both bias images.

Definition at line 296 of file cmtkEntropyMinimizationIntensityCorrectionFunctional.txx.

References cmtk::DataGrid::GetDataAt(), and cmtk::ThreadParameters< T >::thisObject.

template<unsigned int NOrderAdd, unsigned int NOrderMul>
void cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul >::UpdateCorrectionFactors (  ) [private, virtual]

Update polynomial correctionfactors from input image.

Implements cmtk::EntropyMinimizationIntensityCorrectionFunctionalBase.

Definition at line 40 of file cmtkEntropyMinimizationIntensityCorrectionFunctional.txx.


Member Data Documentation

template<unsigned int NOrderAdd, unsigned int NOrderMul>
Types::Coordinate cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul >::m_AddCorrectionAdd[1+PolynomialTypeAdd::NumberOfMonomials] [protected]

Additive correction constants for additive polynomials.

Definition at line 166 of file cmtkEntropyMinimizationIntensityCorrectionFunctional.h.

template<unsigned int NOrderAdd, unsigned int NOrderMul>
Types::Coordinate cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul >::m_AddCorrectionMul[1+PolynomialTypeMul::NumberOfMonomials] [protected]

Additive correction constants for multiplicative polynomials.

Definition at line 172 of file cmtkEntropyMinimizationIntensityCorrectionFunctional.h.

template<unsigned int NOrderAdd, unsigned int NOrderMul>
Types::Coordinate cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul >::m_CoefficientsAdd[1+PolynomialTypeAdd::NumberOfMonomials] [protected]

Additive correction term coefficients.

Definition at line 160 of file cmtkEntropyMinimizationIntensityCorrectionFunctional.h.

template<unsigned int NOrderAdd, unsigned int NOrderMul>
Types::Coordinate cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul >::m_CoefficientsMul[1+PolynomialTypeMul::NumberOfMonomials] [protected]

Multiplicative correction term coefficients.

Definition at line 163 of file cmtkEntropyMinimizationIntensityCorrectionFunctional.h.

template<unsigned int NOrderAdd, unsigned int NOrderMul>
size_t cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul >::m_MonomialsPerThread [private]

Maximum number of monomials per thread (maximum of additive and multiplicative polynomial number of monomials).

Definition at line 187 of file cmtkEntropyMinimizationIntensityCorrectionFunctional.h.

template<unsigned int NOrderAdd, unsigned int NOrderMul>
Types::Coordinate* cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul >::m_MonomialsVec [private]

Temporary storage for evaluating monomials.

Definition at line 190 of file cmtkEntropyMinimizationIntensityCorrectionFunctional.h.

template<unsigned int NOrderAdd, unsigned int NOrderMul>
Types::Coordinate cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul >::m_MulCorrectionAdd[1+PolynomialTypeAdd::NumberOfMonomials] [protected]

Multiplicative correction constants for additive polynomials.

Definition at line 169 of file cmtkEntropyMinimizationIntensityCorrectionFunctional.h.

template<unsigned int NOrderAdd, unsigned int NOrderMul>
Types::Coordinate cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul >::m_MulCorrectionMul[1+PolynomialTypeMul::NumberOfMonomials] [protected]

Multiplicative correction constants for additive polynomials.

Definition at line 175 of file cmtkEntropyMinimizationIntensityCorrectionFunctional.h.

template<unsigned int NOrderAdd, unsigned int NOrderMul>
const size_t cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul >::m_NumberOfParameters = PolynomialTypeAdd::NumberOfMonomials + PolynomialTypeMul::NumberOfMonomials [static]

Total number of parameters is number of additive plus number of multiplicative parameters.

Definition at line 95 of file cmtkEntropyMinimizationIntensityCorrectionFunctional.h.

template<unsigned int NOrderAdd, unsigned int NOrderMul>
size_t cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul >::m_NumberOfThreads [private]

Number of parallel threads.

Because the constructor allocated temporary storage for monomial computation, we need to know in advance how many threads there will be, and make sure we never exceed this number later when calling the thread functions.

Definition at line 184 of file cmtkEntropyMinimizationIntensityCorrectionFunctional.h.

template<unsigned int NOrderAdd, unsigned int NOrderMul>
CoordinateVector cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul >::m_ParameterVector [protected]

Keep a copy of the current parameter vector.

Definition at line 151 of file cmtkEntropyMinimizationIntensityCorrectionFunctional.h.

template<unsigned int NOrderAdd, unsigned int NOrderMul>
Types::Coordinate cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul >::m_StepSizeAdd[1+PolynomialTypeAdd::NumberOfMonomials] [protected]

Additive correction term coefficients.

Definition at line 154 of file cmtkEntropyMinimizationIntensityCorrectionFunctional.h.

template<unsigned int NOrderAdd, unsigned int NOrderMul>
Types::Coordinate cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul >::m_StepSizeMul[1+PolynomialTypeMul::NumberOfMonomials] [protected]

Multiplicative correction term coefficients.

Definition at line 157 of file cmtkEntropyMinimizationIntensityCorrectionFunctional.h.


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