ncut::NcutNode< IMG_ELM_TYPE, MSK_ELM_TYPE > Class Template Reference

NcutNode is one Node in the ncut dendogram. More...

#include <ncutCore.h>

List of all members.

Public Member Functions

const greedy_ptr< const Profile<
IMG_ELM_TYPE, MSK_ELM_TYPE > > 
profile () const
 Get the Profile this Node uses.
const std::map< MSK_ELM_TYPE,
unsigned int > * 
indices () const
 Get the index map of the elements in this NcutNode.
const greedy_ptr< const Ncutncut () const
 Get the Ncut calculated by this NcutNode.
double eigVal () const
 Get the eigenvalue of the eigenvector this NcutNode uses for partitioning.
const double * eigVec () const
 Get a pointer to the eigenvector this NcutNode uses for partitioning.
double splitPoint () const
 Get the splitting point this NcutNode uses for partitioning.
double eigVecNum () const
 Get the number of the eigenvector that was used for partitioning.
const greedy_ptr< const NcutNodeleftNode () const
 Get the left child NcutNode of this NcutNode.
const greedy_ptr< const NcutNoderightNode () const
 Get the right child NcutNode of this NcutNode.
int calculate (unsigned int maxDepth, unsigned int depth, unsigned int nEigVecs, unsigned int eigvn, double *initVec=NULL)
 Constructs the ncut dendogram.
bool isLeft (unsigned int idx) const
 Checks to which half an element is assigned in this node.
 NcutNode (std::auto_ptr< Profile< IMG_ELM_TYPE, MSK_ELM_TYPE > > &profile, const std::map< MSK_ELM_TYPE, unsigned int > &indices, greedy_ptr< Ncut > &ncut, const Setting *setting)
 NcutNode owning constructor, takes ownership of profile.
 NcutNode (greedy_ptr< Profile< IMG_ELM_TYPE, MSK_ELM_TYPE > > &profile, const std::map< MSK_ELM_TYPE, unsigned int > &indices, greedy_ptr< Ncut > &ncut, const Setting *setting)
 NcutNode non-owning constructor, does not own profile.
 NcutNode (const NcutNode &clone)
 NcutNode copy constructor.
 NcutNode (const NcutNode &clone, greedy_ptr< Profile< IMG_ELM_TYPE, MSK_ELM_TYPE > > &pclone, greedy_ptr< Ncut > &nclone)
 NcutNode custom copy constructor.
virtual ~NcutNode ()
 NcutNode destructor.
virtual NcutNodeoperator= (const NcutNode &clone)
 NcutNode assignment operator.

Protected Attributes

greedy_ptr< Profile< IMG_ELM_TYPE,
MSK_ELM_TYPE > > 
profile_
std::map< MSK_ELM_TYPE, unsigned
int > 
indices_
greedy_ptr< Ncutncut_
double eigVal_
const double * eigVec_
double splitPoint_
unsigned int eigVecNum_
greedy_ptr< NcutNodeleftNode_
greedy_ptr< NcutNoderightNode_
const Settingsetting_


Detailed Description

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
class ncut::NcutNode< IMG_ELM_TYPE, MSK_ELM_TYPE >

NcutNode is one Node in the ncut dendogram.

A node represents one bipartition of a segment into two halves. The root NcutNode bipartitions (splits) the whole image. leftNode and rightNode point to the NcutNode s (=partitions) of the two resulting segments or to NULL if the resulting segments aren't partitioned any further. An eigenvector, calculated by the class Ncut, is used as an indicator vector to bipartition a segment. The node does not neccessarily contain a new ncut, an eigenvector of an ncut calculated in a level closer to the root may also be used. If this is the case, ncut_ points to the old ncut, but eigVec_ points to the eigenvector that is used to partition this segment. Segmentation is not performed on pixels, but on elements, for example the segments of a pre-segmentation. Elements have global identifiers and local indices. indices_ is a map from element identifiers to element indices in each NcutNode. This map is also a list of elements that are part of the current segment. Do not use NcutNode directly, construct the ncut dendogram using the functions provided by the class Segmentation.


Constructor & Destructor Documentation

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
ncut::NcutNode< IMG_ELM_TYPE, MSK_ELM_TYPE >::NcutNode std::auto_ptr< Profile< IMG_ELM_TYPE, MSK_ELM_TYPE > > &  profile,
const std::map< MSK_ELM_TYPE, unsigned int > &  indices,
greedy_ptr< Ncut > &  ncut,
const Setting setting
 

NcutNode owning constructor, takes ownership of profile.

Parameters:
profile the profile used for segmentation
indices a list of elements still active in this node and their indices
ncut the ncut from the parent node
setting The parameters of the current segmentation.
Creates a new NcutNode with the Profile profile, element indices list indices and optionally with Ncut ncut. profile is owned by this NcutNode.

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
ncut::NcutNode< IMG_ELM_TYPE, MSK_ELM_TYPE >::NcutNode greedy_ptr< Profile< IMG_ELM_TYPE, MSK_ELM_TYPE > > &  profile,
const std::map< MSK_ELM_TYPE, unsigned int > &  indices,
greedy_ptr< Ncut > &  ncut,
const Setting setting
 

NcutNode non-owning constructor, does not own profile.

Parameters:
profile the profile used for segmentation
indices a list of elements still active in this node and their indices
ncut the ncut this node should use
setting The parameters of the current segmentation.
Creates a new NcutNode with the Profile profile, element indices list indices and optionally with Ncut ncut. profile is not owned by this NcutNode.

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
ncut::NcutNode< IMG_ELM_TYPE, MSK_ELM_TYPE >::NcutNode const NcutNode< IMG_ELM_TYPE, MSK_ELM_TYPE > &  clone  ) 
 

NcutNode copy constructor.

Parameters:
clone The root of the subtree to be cloned.
Clones the NcutNode clone and all its child nodes (e.g. clones the subtree clone is root of).

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
ncut::NcutNode< IMG_ELM_TYPE, MSK_ELM_TYPE >::NcutNode const NcutNode< IMG_ELM_TYPE, MSK_ELM_TYPE > &  clone,
greedy_ptr< Profile< IMG_ELM_TYPE, MSK_ELM_TYPE > > &  pclone,
greedy_ptr< Ncut > &  nclone
 

NcutNode custom copy constructor.

Parameters:
clone The root of the subtree to be cloned.
pclone The Profile this subtree should point to.
nclone The Ncut this subtree should point to.
This copy constructor uses a pointer to a different Profile and a pointer to a different Ncut. These pointers are handed down the tree to make sure every child node of this node will be independent of clone.

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
ncut::NcutNode< IMG_ELM_TYPE, MSK_ELM_TYPE >::~NcutNode  )  [virtual]
 

NcutNode destructor.

Deletes the subtree this NcutNode is root of.


Member Function Documentation

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
int ncut::NcutNode< IMG_ELM_TYPE, MSK_ELM_TYPE >::calculate unsigned int  maxDepth,
unsigned int  depth,
unsigned int  nEigVecs,
unsigned int  eigvn,
double *  initVec = NULL
 

Constructs the ncut dendogram.

Parameters:
maxDepth The maximum depth of the ncut dendogram.
depth The current depth this node is in.
nEigVecs The number of eigenvectors that should be used of each ncut.
eigvn The number of the current eigenvector used to bipartition this segment.
initVec The starting vector used for calculating the ncut.
Returns:
0 if a valid Node was constructed, 1 if the node is invalid and has to be deleted.
Bipartitions the elements contained in indices_ (either using an existing Ncut or calculating a new one). Child nodes are recursively constructed until the maximum depth is reached. If one of the child nodes needs a new Ncut, a new element profile with reduced similarity matrix (only containing the elements in the respective segment) is constructed and passed to the child node.

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
double ncut::NcutNode< IMG_ELM_TYPE, MSK_ELM_TYPE >::eigVal  )  const [inline]
 

Get the eigenvalue of the eigenvector this NcutNode uses for partitioning.

Returns:
Eigenvalue of the eigenvector this NcutNode uses for partitioning.

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
const double* ncut::NcutNode< IMG_ELM_TYPE, MSK_ELM_TYPE >::eigVec  )  const [inline]
 

Get a pointer to the eigenvector this NcutNode uses for partitioning.

Returns:
Pointer to the eigenvector this NcutNode uses for partitioning.

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
double ncut::NcutNode< IMG_ELM_TYPE, MSK_ELM_TYPE >::eigVecNum  )  const [inline]
 

Get the number of the eigenvector that was used for partitioning.

Returns:
Number of the eigenvector that was used for partitioning.

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
const std::map<MSK_ELM_TYPE, unsigned int>* ncut::NcutNode< IMG_ELM_TYPE, MSK_ELM_TYPE >::indices  )  const [inline]
 

Get the index map of the elements in this NcutNode.

Returns:
Index map of the elements in this NcutNode.

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
bool ncut::NcutNode< IMG_ELM_TYPE, MSK_ELM_TYPE >::isLeft unsigned int  idx  )  const
 

Checks to which half an element is assigned in this node.

Parameters:
idx The index of the element to be checked.
Returns:
true if the element is on the left half, false otherwise.
Checks if the element with index idx belongs to the left half of this node's bipartition.

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
const greedy_ptr<const NcutNode> ncut::NcutNode< IMG_ELM_TYPE, MSK_ELM_TYPE >::leftNode  )  const [inline]
 

Get the left child NcutNode of this NcutNode.

Returns:
Left child NcutNode of this NcutNode.

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
const greedy_ptr<const Ncut> ncut::NcutNode< IMG_ELM_TYPE, MSK_ELM_TYPE >::ncut  )  const [inline]
 

Get the Ncut calculated by this NcutNode.

Returns:
Ncut calculated by this NcutNode.

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
NcutNode< IMG_ELM_TYPE, MSK_ELM_TYPE > & ncut::NcutNode< IMG_ELM_TYPE, MSK_ELM_TYPE >::operator= const NcutNode< IMG_ELM_TYPE, MSK_ELM_TYPE > &  clone  )  [virtual]
 

NcutNode assignment operator.

Parameters:
clone The root of the subtree to be cloned.
Returns:
This object.
Clones the NcutNode clone and all its child nodes (e.g. clones the subtree clone is root of).

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
const greedy_ptr<const Profile<IMG_ELM_TYPE, MSK_ELM_TYPE> > ncut::NcutNode< IMG_ELM_TYPE, MSK_ELM_TYPE >::profile  )  const [inline]
 

Get the Profile this Node uses.

Returns:
Profile this Node uses.

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
const greedy_ptr<const NcutNode> ncut::NcutNode< IMG_ELM_TYPE, MSK_ELM_TYPE >::rightNode  )  const [inline]
 

Get the right child NcutNode of this NcutNode.

Returns:
Right child NcutNode of this NcutNode.

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
double ncut::NcutNode< IMG_ELM_TYPE, MSK_ELM_TYPE >::splitPoint  )  const [inline]
 

Get the splitting point this NcutNode uses for partitioning.

Returns:
Splitting point this NcutNode uses for partitioning.


Member Data Documentation

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
double ncut::NcutNode< IMG_ELM_TYPE, MSK_ELM_TYPE >::eigVal_ [protected]
 

the eigenvalue corresponding to the eigenvector used to bipartition this segment

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
const double* ncut::NcutNode< IMG_ELM_TYPE, MSK_ELM_TYPE >::eigVec_ [protected]
 

the eigenvector used to bipartition this segment

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
unsigned int ncut::NcutNode< IMG_ELM_TYPE, MSK_ELM_TYPE >::eigVecNum_ [protected]
 

the number of the eigenvector that was used for bipartitioning

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
std::map<MSK_ELM_TYPE, unsigned int> ncut::NcutNode< IMG_ELM_TYPE, MSK_ELM_TYPE >::indices_ [protected]
 

the list of elements bipartitioned in this node and their indices

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
greedy_ptr<NcutNode> ncut::NcutNode< IMG_ELM_TYPE, MSK_ELM_TYPE >::leftNode_ [protected]
 

the left child node represents the further bipartition of one of the two segments resulting from this bipartition

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
greedy_ptr<Ncut> ncut::NcutNode< IMG_ELM_TYPE, MSK_ELM_TYPE >::ncut_ [protected]
 

the Ncut that calculated the current eigenvector

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
greedy_ptr<Profile<IMG_ELM_TYPE, MSK_ELM_TYPE> > ncut::NcutNode< IMG_ELM_TYPE, MSK_ELM_TYPE >::profile_ [protected]
 

the profile used in this Node

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
greedy_ptr<NcutNode> ncut::NcutNode< IMG_ELM_TYPE, MSK_ELM_TYPE >::rightNode_ [protected]
 

the left child node represents the further bipartition of the other of the two segments resulting from this bipartition

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
const Setting* ncut::NcutNode< IMG_ELM_TYPE, MSK_ELM_TYPE >::setting_ [protected]
 

Contains all needed parameters

template<class IMG_ELM_TYPE, class MSK_ELM_TYPE>
double ncut::NcutNode< IMG_ELM_TYPE, MSK_ELM_TYPE >::splitPoint_ [protected]
 

the threshold for bipartitioning the graph


The documentation for this class was generated from the following file:
Generated on Thu Jun 22 14:47:21 2006 for ncut.kdevelop by  doxygen 1.4.6