MDSTk Libraries
1.1.0
Medical Data Segmentation Toolkit
|
Gaussian Mixture Model (GMM) optimization using maximal likelihood estimation via the Expection-Maximization (EM) algorithm. More...
#include <mdsWeightedEM.h>
Public Types | |
enum | { NO_ITERATOR_IS_DECLARED_FOR_TEMPLATE_PARAMETER = C::ITERATOR_DECLARED } |
Check that C has an iterator declared. More... | |
enum | { NUM_OF_DIMENSIONS = N } |
Dimensionality of input data. More... | |
typedef mds::math::CGaussianFunc < double, N > | tComponent |
Gaussian function. | |
typedef C::tConstIterator | tConstIterator |
Container iterator type. | |
typedef C | tContainer |
Container type. | |
typedef mds::math::CVector < double > | tVector |
Used internal vector type. | |
Public Member Functions | |
CHasOptions & | addOption (int Flag) |
Adds a given flag using bitwise OR operation. | |
bool | checkAllOptions (int Flags) const |
Checks if all specified flags are set. | |
bool | checkAnyOption (int Flags) const |
Checks if any of specified flags is set. | |
int | checkOption (int Flag) const |
Checks if a single flag is set. | |
CHasOptions & | clearOption (int Flag) |
Removes a given flag. | |
CWeightedEM (int Flags=mds::math::MaxLikelihoodByEM::DEFAULT_FLAGS) | |
Default constructor. | |
bool | execute (const tContainer &Input) |
Estimates GMM of input data. | |
bool | execute (const tContainer &Input, tSize NumOfClasses) |
Estimates GMM of input data. | |
const tComponent & | getComponent (tSize i) const |
Returns reference to the i-th gaussian component. | |
tComponent & | getComponent (tSize i) |
bool | getMembership (tSize i, tVector &Membership) |
Returns soft membership function of the i-th input sample. | |
tSize | getMembership (tSize i) |
Returns index of the component into which the i-th input vector was classified (hard membership function). | |
tSize | getNumOfComponents () const |
Returns the number of components. | |
tSize | getNumOfDimensions () const |
Returns the number od dimensions. | |
int | getOptions () const |
Returns all flags. | |
CWeightedEM & | setMinAddChange (double dValue) |
Changes the minimal required change of the log-likelihood function which results in a new component addition. | |
CHasOptions & | setOption (int Flag) |
Adds a given flag using bitwise OR operation. | |
CHasOptions & | setOptions (int Flags) |
Sets complete flags. | |
virtual | ~CWeightedEM () |
Virtual destructor. | |
Protected Types | |
typedef std::vector< tComponent > | tComponents |
Gaussian functions representing mixture components/segments. | |
typedef tComponent::tVector | tCov |
Diagonal of the gaussian component covariance matrix. | |
typedef mds::math::CMatrix < double > | tMaps |
Support maps. | |
typedef tComponent::tVector | tMean |
Gaussian component mean. | |
Protected Member Functions | |
void | addRandomNoise (double dNoiseCoeff) |
Add random noise to i-th component. | |
bool | areSeparated (tSize i, tSize j, int c) |
Checks degree of separation of two given components. | |
bool | checkForSimilarComponents () |
Checks for similar components. | |
void | clearSupportMaps () |
Clears all support maps. | |
double | computeLogLikelihood (const tContainer &Input) |
Returns value of the objective function. | |
double | computeMDL (double dLogLikelihood, tSize NumOfSamples) |
Compute the MDL (Minimum Descriptive Length) coefficient. | |
tSize | findComponent () |
Finds component which can be further splitted. | |
int | getDegreeOfSeparation (tSize NumOfComponents) |
Returns degree of separation. | |
void | initComponentCov (tSize i) |
Intialization of a component covariance matrix. | |
void | initComponentMean (tSize i, const tContainer &Input) |
Random intialization of i-th component mean value. | |
void | initComponentWeight (tSize i, double dWeight) |
Intialization of a component weight. | |
bool | initFirstComponent (const tContainer &Input) |
Initialization of the first mixture component. | |
double | iterateEM (const tContainer &Input, double dMinChange, tSize NumOfSamples) |
Iterates both E-step and M-step. | |
void | processEStep (const tContainer &Input) |
E-step of the algorithm. | |
void | processMStep (const tContainer &Input, tSize NumOfSamples) |
M-step of the algorithm. | |
void | splitComponent (tSize Index, tSize NewIndex) |
Splits a given component. | |
Protected Attributes | |
tComponents | m_Components |
Mixture model components. | |
double | m_dMinAddChange |
Minimal required change of the log-likelihood function which results in component addition. | |
tMaps | m_Maps |
Support maps. | |
mds::math::CNormalPRNG | m_Normal |
Random number generator with normal distribution. | |
int | m_Options |
Optional flags. | |
mds::math::CUniformPRNG | m_Uniform |
Uniform random number generator. |
Gaussian Mixture Model (GMM) optimization using maximal likelihood estimation via the Expection-Maximization (EM) algorithm.
typedef mds::math::CGaussianFunc<double,N> mds::img::CWeightedEM< C, N >::tComponent |
Gaussian function.
typedef std::vector<tComponent> mds::img::CWeightedEM< C, N >::tComponents [protected] |
Gaussian functions representing mixture components/segments.
typedef C::tConstIterator mds::img::CWeightedEM< C, N >::tConstIterator |
Container iterator type.
typedef C mds::img::CWeightedEM< C, N >::tContainer |
Container type.
typedef tComponent::tVector mds::img::CWeightedEM< C, N >::tCov [protected] |
Diagonal of the gaussian component covariance matrix.
typedef mds::math::CMatrix<double> mds::img::CWeightedEM< C, N >::tMaps [protected] |
Support maps.
typedef tComponent::tVector mds::img::CWeightedEM< C, N >::tMean [protected] |
Gaussian component mean.
typedef mds::math::CVector<double> mds::img::CWeightedEM< C, N >::tVector |
Used internal vector type.
anonymous enum |
anonymous enum |
CWeightedEM::CWeightedEM | ( | int | Flags = mds::math::MaxLikelihoodByEM::DEFAULT_FLAGS | ) |
Default constructor.
virtual mds::img::CWeightedEM< C, N >::~CWeightedEM | ( | ) | [virtual] |
Virtual destructor.
CHasOptions& mds::base::CHasOptions::addOption | ( | int | Flag | ) | [inherited] |
Adds a given flag using bitwise OR operation.
void CWeightedEM::addRandomNoise | ( | double | dNoiseCoeff | ) | [protected] |
Add random noise to i-th component.
bool CWeightedEM::areSeparated | ( | tSize | i, |
tSize | j, | ||
int | c | ||
) | [protected] |
Checks degree of separation of two given components.
bool mds::base::CHasOptions::checkAllOptions | ( | int | Flags | ) | const [inherited] |
Checks if all specified flags are set.
bool mds::base::CHasOptions::checkAnyOption | ( | int | Flags | ) | const [inherited] |
Checks if any of specified flags is set.
bool CWeightedEM::checkForSimilarComponents | ( | ) | [protected] |
Checks for similar components.
int mds::base::CHasOptions::checkOption | ( | int | Flag | ) | const [inherited] |
Checks if a single flag is set.
CHasOptions& mds::base::CHasOptions::clearOption | ( | int | Flag | ) | [inherited] |
Removes a given flag.
void CWeightedEM::clearSupportMaps | ( | ) | [protected] |
Clears all support maps.
double CWeightedEM::computeLogLikelihood | ( | const tContainer & | Input | ) | [protected] |
Returns value of the objective function.
double CWeightedEM::computeMDL | ( | double | dLogLikelihood, |
tSize | NumOfSamples | ||
) | [protected] |
Compute the MDL (Minimum Descriptive Length) coefficient.
bool CWeightedEM::execute | ( | const tContainer & | Input | ) |
Estimates GMM of input data.
bool CWeightedEM::execute | ( | const tContainer & | Input, |
tSize | NumOfClasses | ||
) |
Estimates GMM of input data.
tSize CWeightedEM::findComponent | ( | ) | [protected] |
Finds component which can be further splitted.
const tComponent& mds::img::CWeightedEM< C, N >::getComponent | ( | tSize | i | ) | const |
Returns reference to the i-th gaussian component.
tComponent& mds::img::CWeightedEM< C, N >::getComponent | ( | tSize | i | ) |
int CWeightedEM::getDegreeOfSeparation | ( | tSize | NumOfComponents | ) | [protected] |
Returns degree of separation.
bool CWeightedEM::getMembership | ( | tSize | i, |
tVector & | Membership | ||
) |
Returns soft membership function of the i-th input sample.
tSize CWeightedEM::getMembership | ( | tSize | i | ) |
Returns index of the component into which the i-th input vector was classified (hard membership function).
tSize mds::img::CWeightedEM< C, N >::getNumOfComponents | ( | ) | const |
Returns the number of components.
tSize mds::img::CWeightedEM< C, N >::getNumOfDimensions | ( | ) | const |
Returns the number od dimensions.
int mds::base::CHasOptions::getOptions | ( | ) | const [inherited] |
Returns all flags.
void CWeightedEM::initComponentCov | ( | tSize | i | ) | [protected] |
Intialization of a component covariance matrix.
void CWeightedEM::initComponentMean | ( | tSize | i, |
const tContainer & | Input | ||
) | [protected] |
Random intialization of i-th component mean value.
void CWeightedEM::initComponentWeight | ( | tSize | i, |
double | dWeight | ||
) | [protected] |
Intialization of a component weight.
bool CWeightedEM::initFirstComponent | ( | const tContainer & | Input | ) | [protected] |
Initialization of the first mixture component.
double CWeightedEM::iterateEM | ( | const tContainer & | Input, |
double | dMinChange, | ||
tSize | NumOfSamples | ||
) | [protected] |
Iterates both E-step and M-step.
void CWeightedEM::processEStep | ( | const tContainer & | Input | ) | [protected] |
E-step of the algorithm.
void CWeightedEM::processMStep | ( | const tContainer & | Input, |
tSize | NumOfSamples | ||
) | [protected] |
M-step of the algorithm.
CWeightedEM< C, N > & CWeightedEM::setMinAddChange | ( | double | dValue | ) |
Changes the minimal required change of the log-likelihood function which results in a new component addition.
CHasOptions& mds::base::CHasOptions::setOption | ( | int | Flag | ) | [inherited] |
Adds a given flag using bitwise OR operation.
CHasOptions& mds::base::CHasOptions::setOptions | ( | int | Flags | ) | [inherited] |
Sets complete flags.
void CWeightedEM::splitComponent | ( | tSize | Index, |
tSize | NewIndex | ||
) | [protected] |
Splits a given component.
tComponents mds::img::CWeightedEM< C, N >::m_Components [protected] |
Mixture model components.
double mds::img::CWeightedEM< C, N >::m_dMinAddChange [protected] |
Minimal required change of the log-likelihood function which results in component addition.
tMaps mds::img::CWeightedEM< C, N >::m_Maps [protected] |
Support maps.
mds::math::CNormalPRNG mds::img::CWeightedEM< C, N >::m_Normal [protected] |
Random number generator with normal distribution.
int mds::base::CHasOptions::m_Options [protected, inherited] |
Optional flags.
mds::math::CUniformPRNG mds::img::CWeightedEM< C, N >::m_Uniform [protected] |
Uniform random number generator.