MeVisLab Toolbox 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. | |
MLuint | getNewReference (MLdouble imageValue) |
Returns a new, unique cluster reference. | |
void | incrementClusterSize (MLuint reference) |
Increments the size of cluster pointed to by reference. | |
MLuint | merge (MLuint ref1, MLuint ref2) |
Merges cluster determined by ref1 and ref2. | |
const ClusterInfo & | getClusterInfo (MLuint reference) const |
Returns the cluster info for the given reference. | |
const ClusterInfo & | getClusterAt (MLuint rank) const |
Returns the cluster info for a given rank. | |
void | setUserDataAtRank (MLuint rank, MLdouble userData) |
Sets the user data value for a cluster with the given rank. | |
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. | |
void | addPositionToBackgroundBoundingBox (MLint x, MLint y, MLint z) |
Adds the given positions to the bounding box of the background cluster. | |
ML_FORCE_INLINE const ClusterInfo & | getBackground () const |
Returns the background cluster info. | |
std::vector< ClusterInfo > | getClusterInfoList () const |
Returns a list of all clusters. | |
void | calcClusterSizes (const ClusterUserDataParameters &userDataParameters) |
Calculates the cluster sizes and sorts the found cluster by size. | |
MLuint | getNumClusters () const |
Returns the number of clusters. | |
MLuint | getNumVoxelsInCluster (MLuint rankId) const |
Returns the number of voxels of the cluster with the given rank id. | |
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.
ml::ClusterRefCollection::ClusterRefCollection | ( | MLuint | initialCapacity = 10 | ) |
ml::ClusterRefCollection::~ClusterRefCollection | ( | ) |
Adds the given positions to the bounding box of the background cluster.
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.
void ml::ClusterRefCollection::calcClusterSizes | ( | const ClusterUserDataParameters & | userDataParameters | ) |
Calculates the cluster sizes and sorts the found cluster by size.
|
inline |
Returns the background cluster info.
Definition at line 122 of file mlClusterRefCollection.h.
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.
const ClusterInfo & ml::ClusterRefCollection::getClusterInfo | ( | MLuint | reference | ) | const |
Returns the cluster info for the given reference.
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.
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).
|
inline |
Returns the number of clusters.
Definition at line 133 of file mlClusterRefCollection.h.
Returns the number of voxels of the cluster with the given rank id.
Increments the size of cluster pointed to by reference.
Clear ClusterRefCollection and set it to an initialized state.
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.
Sets the user data value for a cluster with the given rank.