Shapeworks Studio  2.1
Shape analysis software suite
List of all members | Public Types | Public Member Functions | Protected Member Functions
itk::PSMPointTreeNode< VDimension > Class Template Reference

#include <itkPSMPointTree.h>

+ Inheritance diagram for itk::PSMPointTreeNode< VDimension >:
+ Collaboration diagram for itk::PSMPointTreeNode< VDimension >:

Public Types

typedef PSMPointTreeNode Self
 
typedef SmartPointer< SelfPointer
 
typedef SmartPointer< const SelfConstPointer
 
typedef LightObject Superclass
 
typedef Point< double, VDimension > PointType
 
typedef std::list< PSMPointIndexPair< VDimension > > PointListType
 

Public Member Functions

 itkTypeMacro (PSMPointTreeNode, LightObject)
 
 itkNewMacro (Self)
 
 itkStaticConstMacro (BranchesPerNode, int,(powstruct< 2, VDimension >::c))
 
bool operator== (const PSMPointTreeNode &o) const
 
bool IsLeaf () const
 
PointListType::iterator InsertElement (const PSMPointIndexPair< VDimension > &elem)
 
bool Contains (const PointType &p) const
 
void SetLowerBound (const PointType &p)
 
const PointTypeGetLowerBound () const
 
void SetUpperBound (const PointType &p)
 
const PointTypeGetUpperBound () const
 
Self::Pointer * GetBranches ()
 
const Self::Pointer * GetBranches () const
 
Self::Pointer & GetBranch (unsigned int i)
 
const Self::Pointer & GetBranch (unsigned int i) const
 
void SetBranch (unsigned int b, typename Self::Pointer n)
 
void PrintSelf (std::ostream &os, Indent indent) const
 
const PointListTypeGetList () const
 
PointListTypeGetList ()
 

Protected Member Functions

 PSMPointTreeNode (const PSMPointTreeNode &o)
 
const PSMPointTreeNodeoperator= (const PSMPointTreeNode &o)
 

Detailed Description

template<unsigned int VDimension>
class itk::PSMPointTreeNode< VDimension >

A node object for use in the PSMPointTree. This class contains a bounding box, a set of child (branch) node pointers, and a linked list that may be filled with Points and Indices (unsigned ints). The single template parameter is the dimensionality of the Points. This class was designed for use as a binning structure for itkPSMNeighborhood classes.

Definition at line 55 of file itkPSMPointTree.h.

Member Typedef Documentation

template<unsigned int VDimension>
typedef std::list<PSMPointIndexPair<VDimension> > itk::PSMPointTreeNode< VDimension >::PointListType

List type for storing lists of points+indices.

Definition at line 76 of file itkPSMPointTree.h.

template<unsigned int VDimension>
typedef Point<double, VDimension> itk::PSMPointTreeNode< VDimension >::PointType

Point type stored in the leaf nodes.

Definition at line 73 of file itkPSMPointTree.h.

template<unsigned int VDimension>
typedef PSMPointTreeNode itk::PSMPointTreeNode< VDimension >::Self

Standard class typedefs.

Definition at line 59 of file itkPSMPointTree.h.

Member Function Documentation

template<unsigned int VDimension>
bool itk::PSMPointTreeNode< VDimension >::Contains ( const PointType p) const
inline

Returns true if the bounding box in this node contains the given point and false otherwise.

Definition at line 103 of file itkPSMPointTree.h.

104  {
105  for (unsigned int i = 0; i < VDimension; i++)
106  {
107  if (p[i] < m_LowerBound[i] || p[i] >= m_UpperBound[i]) return false;
108  }
109  return true;
110  }
template<unsigned int VDimension>
Self::Pointer& itk::PSMPointTreeNode< VDimension >::GetBranch ( unsigned int  i)
inline

Return a specific branch

Definition at line 129 of file itkPSMPointTree.h.

130  { return m_Branches[i]; }
template<unsigned int VDimension>
Self::Pointer* itk::PSMPointTreeNode< VDimension >::GetBranches ( )
inline

Return the data structure holding branch (child) nodes.

Definition at line 123 of file itkPSMPointTree.h.

124  { return m_Branches; }
template<unsigned int VDimension>
const PointListType& itk::PSMPointTreeNode< VDimension >::GetList ( ) const
inline

Get the list of elements which contain points and associated indices.

Definition at line 142 of file itkPSMPointTree.h.

143  { return m_List; }
template<unsigned int VDimension>
PointListType::iterator itk::PSMPointTreeNode< VDimension >::InsertElement ( const PSMPointIndexPair< VDimension > &  elem)
inline

Insert a PointIndexPair into the list associated with this node.

Definition at line 96 of file itkPSMPointTree.h.

97  {
98  return m_List.insert(m_List.end(), elem);
99  }
template<unsigned int VDimension>
bool itk::PSMPointTreeNode< VDimension >::IsLeaf ( ) const
inline

Returns true if this is a leaf node (has no branches) and false otherwise. The assumption is that a non-leaf node cannot have any empty branches. Each level of the tree must contain BranchesPerNode divisions. This assumption speeds up certain types of processing.

Definition at line 89 of file itkPSMPointTree.h.

90  {
91  if (m_Branches[0].GetPointer() != 0) return false;
92  else return true;
93  }
template<unsigned int VDimension>
itk::PSMPointTreeNode< VDimension >::itkNewMacro ( Self  )

Method for creation through the object factory.

template<unsigned int VDimension>
itk::PSMPointTreeNode< VDimension >::itkStaticConstMacro ( BranchesPerNode  ,
int  ,
(powstruct< 2, VDimension >::c)   
)

The number of branches at each node of the tree, which is 2^VDimension, e.g. 4 in 2D, 8 in 3D, etc.

template<unsigned int VDimension>
bool itk::PSMPointTreeNode< VDimension >::operator== ( const PSMPointTreeNode< VDimension > &  o) const
inline

Equivalence operator, ignores value type.

Definition at line 79 of file itkPSMPointTree.h.

80  {
81  if ((m_LowerBound == o.m_LowerBound) && (m_UpperBound == o.m_UpperBound) ) return true;
82  else return false;
83  }
template<unsigned int VDimension>
void itk::PSMPointTreeNode< VDimension >::PrintSelf ( std::ostream &  os,
Indent  indent 
) const

Standard ITK PrintSelf method.

Definition at line 29 of file itkPSMPointTree.hxx.

30  {
31  os << indent << "PSMPointTreeNode: ";
32  os << "m_LowerBound = " << m_LowerBound;
33  os << "\tm_UpperBound = " << m_UpperBound;
34  os << "\tBranchesPerNode = " << BranchesPerNode;
35  os << "\tIsLeaf() = " << this->IsLeaf() << std::endl;
36  os << "\tm_List: ";
37  for (typename PointListType::const_iterator it = m_List.begin();
38  it != m_List.end(); it++)
39  { os << "\t (" << it->Index << ", " << it->Point << ")" << std::endl; }
40  os << std::endl;
41  for (unsigned int i = 0; i < BranchesPerNode; i++)
42  {
43  if (m_Branches[i].GetPointer() != 0) m_Branches[i]->PrintSelf(os, indent);
44  }
45  }
void PrintSelf(std::ostream &os, Indent indent) const
template<unsigned int VDimension>
void itk::PSMPointTreeNode< VDimension >::SetBranch ( unsigned int  b,
typename Self::Pointer  n 
)
inline

Set the node for a specific branch of this node.

Definition at line 135 of file itkPSMPointTree.h.

136  { this->GetBranch(b) = n; }
Self::Pointer & GetBranch(unsigned int i)
template<unsigned int VDimension>
void itk::PSMPointTreeNode< VDimension >::SetLowerBound ( const PointType p)
inline

Set/Get the lower and upper bounds of the region described by this node.

Definition at line 113 of file itkPSMPointTree.h.

114  { m_LowerBound = p; }

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