MeVisLab Toolbox Reference
ml::ClusterRefCollection Class Reference

Class for handling cluster references. More...

#include <mlClusterRefCollection.h>

Public Member Functions

 ClusterRefCollection (MLuint initialCapacity=10)
 
 ~ClusterRefCollection ()
 
void init (MLuint numVoxels)
 Clear ClusterRefCollection and set it to an initialized state. More...
 
MLuint getNewReference (MLdouble imageValue)
 Returns a new, unique cluster reference. More...
 
void incrementClusterSize (MLuint reference)
 Increments the size of cluster pointed to by reference. More...
 
MLuint merge (MLuint ref1, MLuint ref2)
 Merges cluster determined by ref1 and ref2. More...
 
const ClusterInfogetClusterInfo (MLuint reference) const
 Returns the cluster info for the given reference. More...
 
const ClusterInfogetClusterAt (MLuint rank) const
 Returns the cluster info for a given rank. More...
 
void setUserDataAtRank (MLuint rank, MLdouble userData)
 Sets the user data value for a cluster with the given rank. More...
 
void addPositionToClusterBoundingBox (MLuint rank, MLint x, MLint y, MLint z)
 Adds the given positions to the bounding box of the cluster with the given rank. More...
 
void addPositionToBackgroundBoundingBox (MLint x, MLint y, MLint z)
 Adds the given positions to the bounding box of the background cluster. More...
 
ML_FORCE_INLINE const ClusterInfogetBackground () const
 Returns the background cluster info. More...
 
std::vector< ClusterInfogetClusterInfoList () const
 Returns a list of all clusters. More...
 
void calcClusterSizes (const ClusterUserDataParameters &userDataParameters)
 Calculates the cluster sizes and sorts the found cluster by size. More...
 
MLuint getNumClusters () const
 Returns the number of clusters. More...
 
MLuint getNumVoxelsInCluster (MLuint rankId) const
 Returns the number of voxels of the cluster with the given rank id. More...
 

Detailed Description

Class for handling cluster references.

The ClusterAlgorithm works by creating small cluster elements depending on the neighborhood relations between adjacent voxel. These basic elements are merged during the neighbor search.
The internal data structure consists of an array of basic cluster elements which are linked together to the final clusters via pointer links.

Definition at line 82 of file mlClusterRefCollection.h.

Constructor & Destructor Documentation

◆ ClusterRefCollection()

ml::ClusterRefCollection::ClusterRefCollection ( MLuint  initialCapacity = 10)

◆ ~ClusterRefCollection()

ml::ClusterRefCollection::~ClusterRefCollection ( )

Member Function Documentation

◆ addPositionToBackgroundBoundingBox()

void ml::ClusterRefCollection::addPositionToBackgroundBoundingBox ( MLint  x,
MLint  y,
MLint  z 
)

Adds the given positions to the bounding box of the background cluster.

◆ addPositionToClusterBoundingBox()

void ml::ClusterRefCollection::addPositionToClusterBoundingBox ( MLuint  rank,
MLint  x,
MLint  y,
MLint  z 
)

Adds the given positions to the bounding box of the cluster with the given rank.

◆ calcClusterSizes()

void ml::ClusterRefCollection::calcClusterSizes ( const ClusterUserDataParameters userDataParameters)

Calculates the cluster sizes and sorts the found cluster by size.

◆ getBackground()

ML_FORCE_INLINE const ClusterInfo& ml::ClusterRefCollection::getBackground ( ) const
inline

Returns the background cluster info.

Definition at line 122 of file mlClusterRefCollection.h.

◆ getClusterAt()

const ClusterInfo& ml::ClusterRefCollection::getClusterAt ( MLuint  rank) const

Returns the cluster info for a given rank.

Returns the background cluster if the given rank is not found.

◆ getClusterInfo()

const ClusterInfo& ml::ClusterRefCollection::getClusterInfo ( MLuint  reference) const

Returns the cluster info for the given reference.

◆ getClusterInfoList()

std::vector<ClusterInfo> ml::ClusterRefCollection::getClusterInfoList ( ) const

Returns a list of all clusters.

Note that copies of the ClusterInfos are returned, so select/deselect will not have influence on the internal clusterRefs.

◆ getNewReference()

MLuint ml::ClusterRefCollection::getNewReference ( MLdouble  imageValue)

Returns a new, unique cluster reference.

The size of the new cluster is set to 1 voxel. The first reference is 1 (0 means background).

◆ getNumClusters()

MLuint ml::ClusterRefCollection::getNumClusters ( ) const
inline

Returns the number of clusters.

Definition at line 133 of file mlClusterRefCollection.h.

◆ getNumVoxelsInCluster()

MLuint ml::ClusterRefCollection::getNumVoxelsInCluster ( MLuint  rankId) const

Returns the number of voxels of the cluster with the given rank id.

◆ incrementClusterSize()

void ml::ClusterRefCollection::incrementClusterSize ( MLuint  reference)

Increments the size of cluster pointed to by reference.

◆ init()

void ml::ClusterRefCollection::init ( MLuint  numVoxels)

Clear ClusterRefCollection and set it to an initialized state.

◆ merge()

MLuint ml::ClusterRefCollection::merge ( MLuint  ref1,
MLuint  ref2 
)

Merges cluster determined by ref1 and ref2.

The cluster with the bigger id is merged to the cluster with the smaller one. Returns the base ref, i.e. the ref merged to.

◆ setUserDataAtRank()

void ml::ClusterRefCollection::setUserDataAtRank ( MLuint  rank,
MLdouble  userData 
)

Sets the user data value for a cluster with the given rank.


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