ITK  4.13.0
Insight Segmentation and Registration Toolkit
Public Types | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample > Class Template Reference

#include <itkExpectationMaximizationMixtureModelEstimator.h>

+ Inheritance diagram for itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >:
+ Collaboration diagram for itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >:

Detailed Description

template<typename TSample>
class itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >

This class generates the parameter estimates for a mixture model using expectation maximization strategy.

The first template argument is the type of the target sample data. This estimator expects one or more mixture model component objects of the classes derived from the MixtureModelComponentBase. The actual component (or module) parameters are updated by each component. Users can think this class as a strategy or a integration point for the EM procedure. The initial proportion (SetInitialProportions), the input sample (SetSample), the mixture model components (AddComponent), and the maximum iteration (SetMaximumIteration) are required. The EM procedure terminates when the current iteration reaches the maximum iteration or the model parameters converge.

Recent API changes: The static const macro to get the length of a measurement vector, MeasurementVectorSize has been removed to allow the length of a measurement vector to be specified at run time. It is now obtained at run time from the sample set as input. Please use the function GetMeasurementVectorSize() to get the length.

See Also
MixtureModelComponentBase, GaussianMixtureModelComponent
Wiki Examples:
Examples:
Examples/Statistics/ExpectationMaximizationMixtureModelEstimator.cxx, and WikiExamples/Statistics/ExpectationMaximizationMixtureModelEstimator_2D.cxx.

Definition at line 61 of file itkExpectationMaximizationMixtureModelEstimator.h.

Public Types

typedef MembershipFunctionBase
< MeasurementVectorType
ComponentMembershipFunctionType
 
typedef
MixtureModelComponentBase
< TSample > 
ComponentType
 
typedef std::vector
< ComponentType * > 
ComponentVectorType
 
typedef SmartPointer< const SelfConstPointer
 
typedef
GaussianMembershipFunctionType::Pointer 
GaussianMembershipFunctionPointer
 
typedef
GaussianMembershipFunction
< MeasurementVectorType
GaussianMembershipFunctionType
 
typedef TSample::MeasurementType MeasurementType
 
typedef
TSample::MeasurementVectorType 
MeasurementVectorType
 
typedef
MembershipFunctionType::ConstPointer 
MembershipFunctionPointer
 
typedef
SimpleDataObjectDecorator
< ProportionVectorType
MembershipFunctionsWeightsArrayObjectType
 
typedef
MembershipFunctionsWeightsArrayObjectType::Pointer 
MembershipFunctionsWeightsArrayPointer
 
typedef MembershipFunctionBase
< MeasurementVectorType
MembershipFunctionType
 
typedef
MembershipFunctionVectorObjectType::Pointer 
MembershipFunctionVectorObjectPointer
 
typedef
SimpleDataObjectDecorator
< MembershipFunctionVectorType
MembershipFunctionVectorObjectType
 
typedef std::vector
< MembershipFunctionPointer
MembershipFunctionVectorType
 
typedef SmartPointer< SelfPointer
 
typedef Array< double > ProportionVectorType
 
typedef TSample SampleType
 
typedef
ExpectationMaximizationMixtureModelEstimator 
Self
 
typedef Object Superclass
 
enum  TERMINATION_CODE {
  CONVERGED = 0,
  NOT_CONVERGED = 1
}
 
- Public Types inherited from itk::Object
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef Object Self
 
typedef LightObject Superclass
 
- Public Types inherited from itk::LightObject
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef LightObject Self
 

Public Member Functions

int AddComponent (ComponentType *component)
 
ComponentMembershipFunctionTypeGetComponentMembershipFunction (int componentIndex) const
 
int GetCurrentIteration ()
 
const ProportionVectorTypeGetInitialProportions () const
 
int GetMaximumIteration () const
 
const
MembershipFunctionsWeightsArrayObjectType
GetMembershipFunctionsWeightsArray () const
 
unsigned int GetNumberOfComponents () const
 
const
MembershipFunctionVectorObjectType
GetOutput () const
 
const ProportionVectorTypeGetProportions () const
 
const TSample * GetSample () const
 
TERMINATION_CODE GetTerminationCode () const
 
void SetInitialProportions (ProportionVectorType &propotion)
 
void SetMaximumIteration (int numberOfIterations)
 
void SetSample (const TSample *sample)
 
void Update ()
 
- Public Member Functions inherited from itk::Object
unsigned long AddObserver (const EventObject &event, Command *)
 
unsigned long AddObserver (const EventObject &event, Command *) const
 
virtual void DebugOff () const
 
virtual void DebugOn () const
 
CommandGetCommand (unsigned long tag)
 
bool GetDebug () const
 
MetaDataDictionaryGetMetaDataDictionary ()
 
const MetaDataDictionaryGetMetaDataDictionary () const
 
virtual ModifiedTimeType GetMTime () const
 
virtual const TimeStampGetTimeStamp () const
 
bool HasObserver (const EventObject &event) const
 
void InvokeEvent (const EventObject &)
 
void InvokeEvent (const EventObject &) const
 
virtual void Modified () const
 
virtual void Register () const override
 
void RemoveAllObservers ()
 
void RemoveObserver (unsigned long tag)
 
void SetDebug (bool debugFlag) const
 
void SetMetaDataDictionary (const MetaDataDictionary &rhs)
 
virtual void SetReferenceCount (int) override
 
virtual void UnRegister () const noexceptoverride
 
virtual void SetObjectName (std::string _arg)
 
virtual const std::string & GetObjectName () const
 
- Public Member Functions inherited from itk::LightObject
virtual void Delete ()
 
virtual int GetReferenceCount () const
 
 itkCloneMacro (Self)
 
void Print (std::ostream &os, Indent indent=0) const
 

Protected Member Functions

bool CalculateDensities ()
 
double CalculateExpectation () const
 
 ExpectationMaximizationMixtureModelEstimator ()
 
void GenerateData ()
 
virtual void PrintSelf (std::ostream &os, Indent indent) const override
 
bool UpdateComponentParameters ()
 
bool UpdateProportions ()
 
virtual ~ExpectationMaximizationMixtureModelEstimator () override
 
- Protected Member Functions inherited from itk::Object
 Object ()
 
bool PrintObservers (std::ostream &os, Indent indent) const
 
virtual void SetTimeStamp (const TimeStamp &time)
 
virtual ~Object () override
 
- Protected Member Functions inherited from itk::LightObject
virtual LightObject::Pointer InternalClone () const
 
 LightObject ()
 
virtual void PrintHeader (std::ostream &os, Indent indent) const
 
virtual void PrintTrailer (std::ostream &os, Indent indent) const
 
virtual ~LightObject ()
 

Private Attributes

ComponentVectorType m_ComponentVector
 
int m_CurrentIteration
 
ProportionVectorType m_InitialProportions
 
int m_MaxIteration
 
MembershipFunctionVectorObjectPointer m_MembershipFunctionsObject
 
MembershipFunctionsWeightsArrayPointer m_MembershipFunctionsWeightArrayObject
 
ProportionVectorType m_Proportions
 
const TSample * m_Sample
 
TERMINATION_CODE m_TerminationCode
 
virtual const char * GetNameOfClass () const
 
virtual ::itk::LightObject::Pointer CreateAnother () const
 
static Pointer New ()
 

Additional Inherited Members

- Static Public Member Functions inherited from itk::Object
static bool GetGlobalWarningDisplay ()
 
static void GlobalWarningDisplayOff ()
 
static void GlobalWarningDisplayOn ()
 
static Pointer New ()
 
static void SetGlobalWarningDisplay (bool flag)
 
- Static Public Member Functions inherited from itk::LightObject
static void BreakOnError ()
 
static Pointer New ()
 
- Protected Attributes inherited from itk::LightObject
AtomicInt< int > m_ReferenceCount
 

Member Typedef Documentation

Type of the membership function base class

Definition at line 105 of file itkExpectationMaximizationMixtureModelEstimator.h.

Type of the mixture model component base class

Definition at line 98 of file itkExpectationMaximizationMixtureModelEstimator.h.

template<typename TSample >
typedef std::vector< ComponentType * > itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::ComponentVectorType

Type of the component pointer storage

Definition at line 101 of file itkExpectationMaximizationMixtureModelEstimator.h.

template<typename TSample >
typedef SmartPointer< const Self > itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::ConstPointer

Typedef requried to generate dataobject decorated output that can be plugged into SampleClassifierFilter

Definition at line 84 of file itkExpectationMaximizationMixtureModelEstimator.h.

template<typename TSample >
typedef TSample::MeasurementType itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::MeasurementType
template<typename TSample >
typedef TSample::MeasurementVectorType itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::MeasurementVectorType

typedef for decorated array of proportion

Definition at line 127 of file itkExpectationMaximizationMixtureModelEstimator.h.

template<typename TSample >
typedef SmartPointer< Self > itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::Pointer
template<typename TSample >
typedef Array< double > itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::ProportionVectorType

Type of the array of the proportion values

Definition at line 108 of file itkExpectationMaximizationMixtureModelEstimator.h.

template<typename TSample >
typedef TSample itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::SampleType

TSample template argument related typedefs

Definition at line 73 of file itkExpectationMaximizationMixtureModelEstimator.h.

Standard class typedef

Definition at line 65 of file itkExpectationMaximizationMixtureModelEstimator.h.

template<typename TSample >
typedef Object itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::Superclass

Member Enumeration Documentation

Termination status after running optimization

Enumerator
CONVERGED 
NOT_CONVERGED 

Definition at line 158 of file itkExpectationMaximizationMixtureModelEstimator.h.

Constructor & Destructor Documentation

template<typename TSample >
virtual itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::~ExpectationMaximizationMixtureModelEstimator ( )
inlineoverrideprotectedvirtual

Member Function Documentation

template<typename TSample >
int itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::AddComponent ( ComponentType component)

Adds a new component (or class).

template<typename TSample >
bool itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::CalculateDensities ( )
protected
template<typename TSample >
double itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::CalculateExpectation ( ) const
protected
template<typename TSample >
virtual::itk::LightObject::Pointer itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::CreateAnother ( ) const
virtual

Standard macros

Reimplemented from itk::Object.

template<typename TSample >
void itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::GenerateData ( )
protected

Starts the estimation process

template<typename TSample >
ComponentMembershipFunctionType* itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::GetComponentMembershipFunction ( int  componentIndex) const

Gets the membership function specified by componentIndex argument.

template<typename TSample >
int itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::GetCurrentIteration ( )
inline

Gets the current iteration.

Definition at line 143 of file itkExpectationMaximizationMixtureModelEstimator.h.

template<typename TSample >
const ProportionVectorType& itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::GetInitialProportions ( ) const
template<typename TSample >
int itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::GetMaximumIteration ( ) const
template<typename TSample >
const MembershipFunctionsWeightsArrayObjectType* itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::GetMembershipFunctionsWeightsArray ( ) const

Get method for data decorated Membership functions weights array

template<typename TSample >
virtual const char* itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::GetNameOfClass ( ) const
virtual

Standard macros

Reimplemented from itk::Object.

template<typename TSample >
unsigned int itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::GetNumberOfComponents ( ) const

Gets the total number of classes currently plugged in.

template<typename TSample >
const MembershipFunctionVectorObjectType* itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::GetOutput ( ) const

Output Membership function vector containing the membership functions with the final optimized parameters

template<typename TSample >
const ProportionVectorType& itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::GetProportions ( ) const

Gets the result proportion values

template<typename TSample >
const TSample* itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::GetSample ( ) const

Returns the target data

template<typename TSample >
TERMINATION_CODE itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::GetTerminationCode ( ) const

Gets the termination status

template<typename TSample >
static Pointer itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::New ( )
static

Standard macros

template<typename TSample >
virtual void itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::PrintSelf ( std::ostream &  os,
Indent  indent 
) const
overrideprotectedvirtual

Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from itk::Object.

template<typename TSample >
void itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::SetInitialProportions ( ProportionVectorType propotion)

Set/Gets the initial proportion values. The size of proportion vector should be same as the number of component (or classes)

template<typename TSample >
void itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::SetMaximumIteration ( int  numberOfIterations)

Set/Gets the maximum number of iterations. When the optimization process reaches the maximum number of interations, even if the class parameters aren't converged, the optimization process stops.

template<typename TSample >
void itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::SetSample ( const TSample *  sample)

Sets the target data that will be classified by this

template<typename TSample >
void itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::Update ( )

Runs the optimization process.

template<typename TSample >
bool itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::UpdateComponentParameters ( )
protected
template<typename TSample >
bool itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::UpdateProportions ( )
protected

Member Data Documentation

template<typename TSample >
ComponentVectorType itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::m_ComponentVector
private
template<typename TSample >
int itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::m_CurrentIteration
private
template<typename TSample >
ProportionVectorType itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::m_InitialProportions
private
template<typename TSample >
int itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::m_MaxIteration
private
template<typename TSample >
MembershipFunctionVectorObjectPointer itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::m_MembershipFunctionsObject
private
template<typename TSample >
MembershipFunctionsWeightsArrayPointer itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::m_MembershipFunctionsWeightArrayObject
private
template<typename TSample >
ProportionVectorType itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::m_Proportions
private
template<typename TSample >
const TSample* itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::m_Sample
private

Target data sample pointer

Definition at line 189 of file itkExpectationMaximizationMixtureModelEstimator.h.

template<typename TSample >
TERMINATION_CODE itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::m_TerminationCode
private

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