ITK  5.2.0
Insight Toolkit
Public Types | 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 >:

Public Types

using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = ExpectationMaximizationMixtureModelEstimator
 
using Superclass = Object
 
- Public Types inherited from itk::Object
using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = Object
 
using Superclass = LightObject
 
- Public Types inherited from itk::LightObject
using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = LightObject
 
using SampleType = TSample
 
using MeasurementType = typename TSample::MeasurementType
 
using MeasurementVectorType = typename TSample::MeasurementVectorType
 
using GaussianMembershipFunctionType = GaussianMembershipFunction< MeasurementVectorType >
 
using GaussianMembershipFunctionPointer = typename GaussianMembershipFunctionType::Pointer
 
using MembershipFunctionType = MembershipFunctionBase< MeasurementVectorType >
 
using MembershipFunctionPointer = typename MembershipFunctionType::ConstPointer
 
using MembershipFunctionVectorType = std::vector< MembershipFunctionPointer >
 
using MembershipFunctionVectorObjectType = SimpleDataObjectDecorator< MembershipFunctionVectorType >
 
using MembershipFunctionVectorObjectPointer = typename MembershipFunctionVectorObjectType::Pointer
 
using ComponentType = MixtureModelComponentBase< TSample >
 
using ComponentVectorType = std::vector< ComponentType * >
 
using ComponentMembershipFunctionType = MembershipFunctionBase< MeasurementVectorType >
 
using ProportionVectorType = Array< double >
 
using MembershipFunctionsWeightsArrayObjectType = SimpleDataObjectDecorator< ProportionVectorType >
 
using MembershipFunctionsWeightsArrayPointer = typename MembershipFunctionsWeightsArrayObjectType::Pointer
 
using TERMINATION_CODE_ENUM = ExpectationMaximizationMixtureModelEstimatorEnums::TERMINATION_CODE
 
const TSample * m_Sample
 
int m_MaxIteration { 100 }
 
int m_CurrentIteration { 0 }
 
TERMINATION_CODE_ENUM m_TerminationCode { TERMINATION_CODE_ENUM::NOT_CONVERGED }
 
ComponentVectorType m_ComponentVector
 
ProportionVectorType m_InitialProportions
 
ProportionVectorType m_Proportions
 
MembershipFunctionVectorObjectPointer m_MembershipFunctionsObject
 
MembershipFunctionsWeightsArrayPointer m_MembershipFunctionsWeightArrayObject
 
virtual const char * GetNameOfClass () const
 
virtual ::itk::LightObject::Pointer CreateAnother () const
 
void SetSample (const TSample *sample)
 
const TSample * GetSample () const
 
void SetInitialProportions (ProportionVectorType &propotion)
 
const ProportionVectorTypeGetInitialProportions () const
 
const ProportionVectorTypeGetProportions () const
 
const MembershipFunctionsWeightsArrayObjectTypeGetMembershipFunctionsWeightsArray () const
 
void SetMaximumIteration (int numberOfIterations)
 
int GetMaximumIteration () const
 
int GetCurrentIteration ()
 
int AddComponent (ComponentType *component)
 
unsigned int GetNumberOfComponents () const
 
void Update ()
 
TERMINATION_CODE_ENUM GetTerminationCode () const
 
ComponentMembershipFunctionTypeGetComponentMembershipFunction (int componentIndex) const
 
const MembershipFunctionVectorObjectTypeGetOutput () const
 
static Pointer New ()
 
 ExpectationMaximizationMixtureModelEstimator ()
 
 ~ExpectationMaximizationMixtureModelEstimator () override=default
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
bool CalculateDensities ()
 
double CalculateExpectation () const
 
bool UpdateComponentParameters ()
 
bool UpdateProportions ()
 
void GenerateData ()
 

Additional Inherited Members

- Public Member Functions inherited from itk::Object
unsigned long AddObserver (const EventObject &event, Command *)
 
unsigned long AddObserver (const EventObject &event, Command *) const
 
unsigned long AddObserver (const EventObject &event, std::function< void(const EventObject &)> function) 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
 
void Register () const override
 
void RemoveAllObservers ()
 
void RemoveObserver (unsigned long tag)
 
void SetDebug (bool debugFlag) const
 
void SetReferenceCount (int) override
 
void UnRegister () const noexcept override
 
void SetMetaDataDictionary (const MetaDataDictionary &rhs)
 
void SetMetaDataDictionary (MetaDataDictionary &&rrhs)
 
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
 
- 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 Member Functions inherited from itk::Object
 Object ()
 
 ~Object () override
 
bool PrintObservers (std::ostream &os, Indent indent) const
 
virtual void SetTimeStamp (const TimeStamp &time)
 
- 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 ()
 
- Protected Attributes inherited from itk::LightObject
std::atomic< int > m_ReferenceCount
 

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
ITK Sphinx Examples:
Examples
Examples/Statistics/ExpectationMaximizationMixtureModelEstimator.cxx, SphinxExamples/src/Numerics/Statistics/2DGaussianMixtureModelExpectMax/Code.cxx, SphinxExamples/src/Numerics/Statistics/DistributeSamplingUsingGMM/Code.cxx, and SphinxExamples/src/Numerics/Statistics/DistributionOfPixelsUsingGMM/Code.cxx.

Definition at line 86 of file itkExpectationMaximizationMixtureModelEstimator.h.

Member Typedef Documentation

◆ ComponentMembershipFunctionType

Type of the membership function base class

Definition at line 124 of file itkExpectationMaximizationMixtureModelEstimator.h.

◆ ComponentType

Type of the mixture model component base class

Definition at line 118 of file itkExpectationMaximizationMixtureModelEstimator.h.

◆ ComponentVectorType

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

Type of the component pointer storage

Definition at line 121 of file itkExpectationMaximizationMixtureModelEstimator.h.

◆ ConstPointer

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

◆ GaussianMembershipFunctionPointer

TSample template argument related type alias

Definition at line 109 of file itkExpectationMaximizationMixtureModelEstimator.h.

◆ GaussianMembershipFunctionType

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

Definition at line 107 of file itkExpectationMaximizationMixtureModelEstimator.h.

◆ MeasurementType

template<typename TSample >
using itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::MeasurementType = typename TSample::MeasurementType

TSample template argument related type alias

Definition at line 102 of file itkExpectationMaximizationMixtureModelEstimator.h.

◆ MeasurementVectorType

template<typename TSample >
using itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::MeasurementVectorType = typename TSample::MeasurementVectorType

TSample template argument related type alias

Definition at line 103 of file itkExpectationMaximizationMixtureModelEstimator.h.

◆ MembershipFunctionPointer

TSample template argument related type alias

Definition at line 112 of file itkExpectationMaximizationMixtureModelEstimator.h.

◆ MembershipFunctionsWeightsArrayObjectType

type alias for decorated array of proportion

Definition at line 150 of file itkExpectationMaximizationMixtureModelEstimator.h.

◆ MembershipFunctionsWeightsArrayPointer

TSample template argument related type alias

Definition at line 151 of file itkExpectationMaximizationMixtureModelEstimator.h.

◆ MembershipFunctionType

TSample template argument related type alias

Definition at line 111 of file itkExpectationMaximizationMixtureModelEstimator.h.

◆ MembershipFunctionVectorObjectPointer

TSample template argument related type alias

Definition at line 115 of file itkExpectationMaximizationMixtureModelEstimator.h.

◆ MembershipFunctionVectorObjectType

TSample template argument related type alias

Definition at line 114 of file itkExpectationMaximizationMixtureModelEstimator.h.

◆ MembershipFunctionVectorType

TSample template argument related type alias

Definition at line 113 of file itkExpectationMaximizationMixtureModelEstimator.h.

◆ Pointer

◆ ProportionVectorType

template<typename TSample >
using itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::ProportionVectorType = Array<double>

Type of the array of the proportion values

Definition at line 127 of file itkExpectationMaximizationMixtureModelEstimator.h.

◆ SampleType

template<typename TSample >
using itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::SampleType = TSample

TSample template argument related type alias

Definition at line 101 of file itkExpectationMaximizationMixtureModelEstimator.h.

◆ Self

Standard class type alias

Definition at line 90 of file itkExpectationMaximizationMixtureModelEstimator.h.

◆ Superclass

template<typename TSample >
using itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::Superclass = Object

◆ TERMINATION_CODE_ENUM

TSample template argument related type alias

Definition at line 186 of file itkExpectationMaximizationMixtureModelEstimator.h.

Constructor & Destructor Documentation

◆ ExpectationMaximizationMixtureModelEstimator()

TSample template argument related type alias

◆ ~ExpectationMaximizationMixtureModelEstimator()

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

TSample template argument related type alias

Member Function Documentation

◆ AddComponent()

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

Adds a new component (or class).

◆ CalculateDensities()

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

TSample template argument related type alias

◆ CalculateExpectation()

template<typename TSample >
double itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::CalculateExpectation ( ) const
protected

TSample template argument related type alias

◆ CreateAnother()

template<typename TSample >
virtual::itk::LightObject::Pointer itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::CreateAnother ( ) const
virtual

TSample template argument related type alias

Reimplemented from itk::Object.

◆ GenerateData()

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

Starts the estimation process

◆ GetComponentMembershipFunction()

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

Gets the membership function specified by componentIndex argument.

◆ GetCurrentIteration()

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

Gets the current iteration.

Definition at line 169 of file itkExpectationMaximizationMixtureModelEstimator.h.

◆ GetInitialProportions()

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

TSample template argument related type alias

◆ GetMaximumIteration()

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

TSample template argument related type alias

◆ GetMembershipFunctionsWeightsArray()

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

Get method for data decorated Membership functions weights array

◆ GetNameOfClass()

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

Standard macros

Reimplemented from itk::Object.

◆ GetNumberOfComponents()

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

Gets the total number of classes currently plugged in.

◆ GetOutput()

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

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

◆ GetProportions()

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

Gets the result proportion values

◆ GetSample()

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

Returns the target data

◆ GetTerminationCode()

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

Gets the termination status

◆ New()

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

TSample template argument related type alias

◆ PrintSelf()

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

TSample template argument related type alias

Reimplemented from itk::Object.

◆ SetInitialProportions()

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)

◆ SetMaximumIteration()

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 iterations, even if the class parameters aren't converged, the optimization process stops.

◆ SetSample()

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

Sets the target data that will be classified by this

◆ Update()

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

Runs the optimization process.

◆ UpdateComponentParameters()

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

TSample template argument related type alias

◆ UpdateProportions()

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

TSample template argument related type alias

Member Data Documentation

◆ m_ComponentVector

template<typename TSample >
ComponentVectorType itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::m_ComponentVector
private

TSample template argument related type alias

Definition at line 237 of file itkExpectationMaximizationMixtureModelEstimator.h.

◆ m_CurrentIteration

template<typename TSample >
int itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::m_CurrentIteration { 0 }
private

TSample template argument related type alias

Definition at line 234 of file itkExpectationMaximizationMixtureModelEstimator.h.

◆ m_InitialProportions

template<typename TSample >
ProportionVectorType itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::m_InitialProportions
private

TSample template argument related type alias

Definition at line 238 of file itkExpectationMaximizationMixtureModelEstimator.h.

◆ m_MaxIteration

template<typename TSample >
int itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::m_MaxIteration { 100 }
private

TSample template argument related type alias

Definition at line 233 of file itkExpectationMaximizationMixtureModelEstimator.h.

◆ m_MembershipFunctionsObject

template<typename TSample >
MembershipFunctionVectorObjectPointer itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::m_MembershipFunctionsObject
private

TSample template argument related type alias

Definition at line 241 of file itkExpectationMaximizationMixtureModelEstimator.h.

◆ m_MembershipFunctionsWeightArrayObject

template<typename TSample >
MembershipFunctionsWeightsArrayPointer itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::m_MembershipFunctionsWeightArrayObject
private

TSample template argument related type alias

Definition at line 242 of file itkExpectationMaximizationMixtureModelEstimator.h.

◆ m_Proportions

template<typename TSample >
ProportionVectorType itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::m_Proportions
private

TSample template argument related type alias

Definition at line 239 of file itkExpectationMaximizationMixtureModelEstimator.h.

◆ m_Sample

template<typename TSample >
const TSample* itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::m_Sample
private

Target data sample pointer

Definition at line 231 of file itkExpectationMaximizationMixtureModelEstimator.h.

◆ m_TerminationCode

TSample template argument related type alias

Definition at line 236 of file itkExpectationMaximizationMixtureModelEstimator.h.


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