OpenWalnut  1.4.0
Public Member Functions | Private Member Functions | Private Attributes
WHierarchicalTreeVoxels Class Reference

Class implements a hierarchical tree and provides helper functions for selection and navigation. More...

#include <WHierarchicalTreeVoxels.h>

+ Inheritance diagram for WHierarchicalTreeVoxels:

List of all members.

Public Member Functions

 WHierarchicalTreeVoxels ()
 standard constructor
 ~WHierarchicalTreeVoxels ()
 destructor
std::vector< size_tgetVoxelsForCluster (size_t cluster)
 getter
void addLeaf (size_t voxelnum)
 A leaf is at the very bottom of the tree, it represents a single fiber or voxel, for several purposes a leaf also counts as a cluster.
void addCluster (size_t cluster1, size_t cluster2, float customData)
 adds a cluster to the set, it combines 2 already existing clusters
size_t getVoxelNum (size_t leaf)
 getter
std::vector< size_tfindClustersForValue (float value)
 finds the clusters for a given similarity value
std::vector< size_tfindClustersForBranchLength (float value, size_t minSize=100)
 finds the clusters for a given similarity value
std::vector< size_tfindXClusters (size_t root, size_t number)
 finds a number of clusters, the algorithm travers down the tree and will always split the cluster with the highest energy level.

Private Member Functions

void addLeaf ()
 A leaf is at the very bottom of the tree, it represents a single fiber or voxel, for several purposes a leaf also counts as a cluster.

Private Attributes

std::vector< size_tm_voxelnums
 stores the voxel id of each leaf node

Detailed Description

Class implements a hierarchical tree and provides helper functions for selection and navigation.

Definition at line 43 of file WHierarchicalTreeVoxels.h.


Constructor & Destructor Documentation

standard constructor

Definition at line 34 of file WHierarchicalTreeVoxels.cpp.

destructor

Definition at line 39 of file WHierarchicalTreeVoxels.cpp.


Member Function Documentation

void WHierarchicalTreeVoxels::addCluster ( size_t  cluster1,
size_t  cluster2,
float  customData 
)

adds a cluster to the set, it combines 2 already existing clusters

Parameters:
cluster1first cluster to add
cluster2second cluster to add
customDatasome arbitrary data stored with the cluster

Definition at line 68 of file WHierarchicalTreeVoxels.cpp.

References WHierarchicalTree::m_children, WHierarchicalTree::m_clusterCount, WHierarchicalTree::m_colors, WHierarchicalTree::m_containsLeafes, WHierarchicalTree::m_customData, WHierarchicalTree::m_leafesLocked, WHierarchicalTree::m_level, WHierarchicalTree::m_maxLevel, WHierarchicalTree::m_parents, and WHierarchicalTree::size().

A leaf is at the very bottom of the tree, it represents a single fiber or voxel, for several purposes a leaf also counts as a cluster.

Parameters:
voxelnumthe voxel id for this leaf

Definition at line 47 of file WHierarchicalTreeVoxels.cpp.

References WHierarchicalTree::m_children, WHierarchicalTree::m_clusterCount, WHierarchicalTree::m_colors, WHierarchicalTree::m_containsLeafes, WHierarchicalTree::m_customData, WHierarchicalTree::m_leafCount, WHierarchicalTree::m_leafesLocked, WHierarchicalTree::m_level, WHierarchicalTree::m_parents, and m_voxelnums.

void WHierarchicalTreeVoxels::addLeaf ( ) [private, virtual]

A leaf is at the very bottom of the tree, it represents a single fiber or voxel, for several purposes a leaf also counts as a cluster.

Implements WHierarchicalTree.

Definition at line 43 of file WHierarchicalTreeVoxels.cpp.

std::vector< size_t > WHierarchicalTreeVoxels::findClustersForBranchLength ( float  value,
size_t  minSize = 100 
)

finds the clusters for a given similarity value

Parameters:
valueonly return clusters where the distance in energy level to its parent is large than this value
minSizeonly return clusters with a number of voxels large than minSize
Returns:
all clusters below that value

Definition at line 148 of file WHierarchicalTreeVoxels.cpp.

References WHierarchicalTree::m_children, WHierarchicalTree::m_clusterCount, WHierarchicalTree::m_containsLeafes, WHierarchicalTree::m_customData, WHierarchicalTree::m_leafCount, WHierarchicalTree::m_parents, and WHierarchicalTree::size().

std::vector< size_t > WHierarchicalTreeVoxels::findClustersForValue ( float  value)

finds the clusters for a given similarity value

Parameters:
value
Returns:
all clusters below that value

Definition at line 107 of file WHierarchicalTreeVoxels.cpp.

References WHierarchicalTree::getCustomData(), WHierarchicalTree::m_children, WHierarchicalTree::m_clusterCount, WHierarchicalTree::m_containsLeafes, and WHierarchicalTree::size().

std::vector< size_t > WHierarchicalTreeVoxels::findXClusters ( size_t  root,
size_t  number 
)

finds a number of clusters, the algorithm travers down the tree and will always split the cluster with the highest energy level.

Parameters:
rootthe cluster to start traversing the tree from
numberthe number of cluster we want to find
Returns:
the clusters

Definition at line 171 of file WHierarchicalTreeVoxels.cpp.

References WHierarchicalTree::m_children, and WHierarchicalTree::m_customData.

getter

Parameters:
leaf
Returns:
the voxel num of a leaf node in the tree

Definition at line 121 of file WHierarchicalTreeVoxels.h.

References m_voxelnums.

getter

Parameters:
clusterthe cluster to work on
Returns:
vector of voxels contained by this cluster

Definition at line 96 of file WHierarchicalTreeVoxels.cpp.

References WHierarchicalTree::getLeafesForCluster(), and m_voxelnums.


Member Data Documentation

stores the voxel id of each leaf node

Definition at line 118 of file WHierarchicalTreeVoxels.h.

Referenced by addLeaf(), getVoxelNum(), and getVoxelsForCluster().


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