MDSTk Libraries  1.1.0
Medical Data Segmentation Toolkit
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
mds::math::CFuzzyCMeans< C, N > Class Template Reference

#include <mdsFuzzyCMeans.h>

Inheritance diagram for mds::math::CFuzzyCMeans< C, N >:
Inheritance graph
[legend]

List of all members.

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 CStaticVector< double, NtCluster
 Vector representing one cluster.
typedef C::tConstIterator tConstIterator
 Container iterator type.
typedef C tContainer
 Container type.
typedef tConstIterator::tItem tItem
 Container item.
typedef CVector< double > tVector
 Used internal vector type.

Public Member Functions

CHasOptionsaddOption (int Flag)
 Adds a given flag using bitwise OR operation.
 CFuzzyCMeans (int Flags=FuzzyCMeans::DEFAULT_FLAGS)
 Default constructor.
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.
CHasOptionsclearOption (int Flag)
 Removes a given flag.
bool execute (const tContainer &Input)
 Clustering of a given set of numbers or vectors.
bool execute (const tContainer &Input, tSize NumOfClusters)
 Clustering of a given set of numbers or vectors.
bool getCluster (tSize i, tCluster &Cluster)
 Returns center of the i-th cluster.
bool getMembership (tSize i, tVector &Membership)
 Returns soft membership function of the i-th input sample.
tSize getMembership (tSize i)
 Returns index of the cluster into which the i-th input vector was classified (hard membership function).
tSize getNumOfClusters () const
 Returns the number of clusters.
tSize getNumOfDimensions () const
 Returns the number od dimensions.
int getOptions () const
 Returns all flags.
CHasOptionssetOption (int Flag)
 Adds a given flag using bitwise OR operation.
CHasOptionssetOptions (int Flags)
 Sets complete flags.
CFuzzyCMeanssetWeight (double dWeight)
 Changes the weighting factor.
virtual ~CFuzzyCMeans ()
 Virtual destructor.

Protected Types

typedef CMatrix< double > tMatrix
 Used internal matrix type.

Protected Member Functions

bool checkMembership ()
 Checks if the membership matrix is O.K.
double computeDunnCoefficient ()
 Computes the Dunn's partitions coefficient.
double getMembership (const tItem &Sample, tSize i)
 Returns membership of a given sample in i-th cluster.
void initMembership ()
 Randomly initializes the membership matrix.
void iterateFCM (const tContainer &Input, double dMinChange)
 Iterates FCM.
void recomputeClusterCenters (const tContainer &Input)
 Compute new positions of cluster centers.
void recomputeMembership (const tContainer &Input)
 Re-computes membership for every sample.
double recomputeObjectiveFunction (const tContainer &Input)
 Returns value of the objective function.
void recomputePowers ()
 Re-computes matrix of powers of the membership function.

Protected Attributes

tMatrix m_Clusters
 Cluster centers.
double m_dExponent
 Helper variables.
double m_dWeight
 Weighting factor.
tMatrix m_Membership
 Membership matrix.
int m_Options
 Optional flags.
tMatrix m_Powers
 Helper matrix.
CUniformPRNG m_Uniform
 Uniform random number generator.

template<class C, tSize N>
class mds::math::CFuzzyCMeans< C, N >


Member Typedef Documentation

template<class C , tSize N>
typedef CStaticVector<double,N> mds::math::CFuzzyCMeans< C, N >::tCluster

Vector representing one cluster.

template<class C , tSize N>
typedef C::tConstIterator mds::math::CFuzzyCMeans< C, N >::tConstIterator

Container iterator type.

template<class C , tSize N>
typedef C mds::math::CFuzzyCMeans< C, N >::tContainer

Container type.

template<class C , tSize N>
typedef tConstIterator::tItem mds::math::CFuzzyCMeans< C, N >::tItem

Container item.

template<class C , tSize N>
typedef CMatrix<double> mds::math::CFuzzyCMeans< C, N >::tMatrix [protected]

Used internal matrix type.

template<class C , tSize N>
typedef CVector<double> mds::math::CFuzzyCMeans< C, N >::tVector

Used internal vector type.


Member Enumeration Documentation

template<class C , tSize N>
anonymous enum

Check that C has an iterator declared.

You will see name of this enum somewhere in compiler error message if the type C can't be used with iterators.

Enumerator:
NO_ITERATOR_IS_DECLARED_FOR_TEMPLATE_PARAMETER 
template<class C , tSize N>
anonymous enum

Dimensionality of input data.

Enumerator:
NUM_OF_DIMENSIONS 

Constructor & Destructor Documentation

template<class C , tSize N>
CFuzzyCMeans::CFuzzyCMeans ( int  Flags = FuzzyCMeans::DEFAULT_FLAGS)

Default constructor.

template<class C , tSize N>
virtual mds::math::CFuzzyCMeans< C, N >::~CFuzzyCMeans ( ) [virtual]

Virtual destructor.


Member Function Documentation

Adds a given flag using bitwise OR operation.

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.

template<class C , tSize N>
bool CFuzzyCMeans::checkMembership ( ) [protected]

Checks if the membership matrix is O.K.

int mds::base::CHasOptions::checkOption ( int  Flag) const [inherited]

Checks if a single flag is set.

  • Returns zero on false.

Removes a given flag.

template<class C , tSize N>
double CFuzzyCMeans::computeDunnCoefficient ( ) [protected]

Computes the Dunn's partitions coefficient.

template<class C , tSize N>
bool CFuzzyCMeans::execute ( const tContainer Input)

Clustering of a given set of numbers or vectors.

  • Optimal number of clusters is estimated.
  • Return false on failure.
template<class C , tSize N>
bool CFuzzyCMeans::execute ( const tContainer Input,
tSize  NumOfClusters 
)

Clustering of a given set of numbers or vectors.

  • Return false on failure.
template<class C , tSize N>
bool CFuzzyCMeans::getCluster ( tSize  i,
tCluster Cluster 
)

Returns center of the i-th cluster.

  • Method can be called after successfull clustering process!
template<class C , tSize N>
bool CFuzzyCMeans::getMembership ( tSize  i,
tVector Membership 
)

Returns soft membership function of the i-th input sample.

  • Method can be called after successfull clustering process!
template<class C , tSize N>
tSize CFuzzyCMeans::getMembership ( tSize  i)

Returns index of the cluster into which the i-th input vector was classified (hard membership function).

  • Method can be called after successfull clustering process!
template<class C , tSize N>
double CFuzzyCMeans::getMembership ( const tItem Sample,
tSize  i 
) [protected]

Returns membership of a given sample in i-th cluster.

template<class C , tSize N>
tSize mds::math::CFuzzyCMeans< C, N >::getNumOfClusters ( ) const

Returns the number of clusters.

  • Method can be called after successfull clustering process!
template<class C , tSize N>
tSize mds::math::CFuzzyCMeans< C, N >::getNumOfDimensions ( ) const

Returns the number od dimensions.

int mds::base::CHasOptions::getOptions ( ) const [inherited]

Returns all flags.

template<class C , tSize N>
void CFuzzyCMeans::initMembership ( ) [protected]

Randomly initializes the membership matrix.

template<class C , tSize N>
void CFuzzyCMeans::iterateFCM ( const tContainer Input,
double  dMinChange 
) [protected]

Iterates FCM.

template<class C , tSize N>
void CFuzzyCMeans::recomputeClusterCenters ( const tContainer Input) [protected]

Compute new positions of cluster centers.

template<class C , tSize N>
void CFuzzyCMeans::recomputeMembership ( const tContainer Input) [protected]

Re-computes membership for every sample.

template<class C , tSize N>
double CFuzzyCMeans::recomputeObjectiveFunction ( const tContainer Input) [protected]

Returns value of the objective function.

template<class C , tSize N>
void CFuzzyCMeans::recomputePowers ( ) [protected]

Re-computes matrix of powers of the membership function.

Adds a given flag using bitwise OR operation.

Sets complete flags.

template<class C , tSize N>
CFuzzyCMeans< C, N > & CFuzzyCMeans::setWeight ( double  dWeight)

Changes the weighting factor.


Member Data Documentation

template<class C , tSize N>
tMatrix mds::math::CFuzzyCMeans< C, N >::m_Clusters [protected]

Cluster centers.

template<class C , tSize N>
double mds::math::CFuzzyCMeans< C, N >::m_dExponent [protected]

Helper variables.

template<class C , tSize N>
double mds::math::CFuzzyCMeans< C, N >::m_dWeight [protected]

Weighting factor.

template<class C , tSize N>
tMatrix mds::math::CFuzzyCMeans< C, N >::m_Membership [protected]

Membership matrix.

int mds::base::CHasOptions::m_Options [protected, inherited]

Optional flags.

template<class C , tSize N>
tMatrix mds::math::CFuzzyCMeans< C, N >::m_Powers [protected]

Helper matrix.

template<class C , tSize N>
CUniformPRNG mds::math::CFuzzyCMeans< C, N >::m_Uniform [protected]

Uniform random number generator.


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