Skip to content

itk::PowerOfTwoPointTree

More...

#include <itkPowerOfTwoPointTree.h>

Inherits from DataObject

Public Types

Name
typedef PowerOfTwoPointTree Self
typedef DataObject Superclass
typedef SmartPointer< Self > Pointer
typedef SmartPointer< const Self > ConstPointer
typedef WeakPointer< const Self > ConstWeakPointer
typedef PowerOfTwoPointTreeNode< VDimension > NodeType
typedef NodeType::Pointer NodePointerType
typedef PowerOfTwoPointTreeNode< VDimension >::PointType PointType
typedef NodeType::PointListType PointListType
typedef std::vector< typename PointListType::const_iterator > PointIteratorListType

Public Functions

Name
itkNewMacro(Self )
itkTypeMacro(PowerOfTwoPointTree , DataObject )
itkStaticConstMacro(Dimension , unsigned int , VDimension )
itkStaticConstMacro(BranchesPerNode , int , (powstruct< 2, VDimension >::c) )
itkGetMacro(Depth , unsigned int )
void ConstructTree(const PointType & , const PointType & , unsigned int )
PointIteratorListType FindPointsInRegion(const PointType & , const PointType & ) const
unsigned int FindPointsInRegion(const PointType & , const PointType & , PointIteratorListType & ) const
NodePointerType GetNode(const PointType & )
const NodePointerType GetNode(const PointType & ) const
itkGetObjectMacro(Root , NodeType )
itkSetObjectMacro(Root , NodeType )
PointListType::iterator AddPoint(const PointType & , unsigned int , NodePointerType & )
PointListType::iterator AddPoint(const PointType & p, unsigned int i)
bool Overlap(const NodePointerType & , const PointType & , const PointType & ) const
bool RegionContains(const PointType & p, const PointType & lowerbound, const PointType & upperbound) const
void PrintSelf(std::ostream & os, Indent indent) const

Protected Functions

Name
PowerOfTwoPointTree()
virtual ~PowerOfTwoPointTree()
void BranchNode(NodePointerType & , unsigned int )
void FindOneNodeInRegion(const NodePointerType & , const PointType & , const PointType & , PointIteratorListType & ) const

Detailed Description

template <unsigned int VDimension>
class itk::PowerOfTwoPointTree;

A tree data container, templated over node type, whose nodes are associated with bounding boxes in a rectangular domain, and that has 2^D branches at each node, where D is the dimensionality of the domain. In 2D this is a quad-tree, and in 3D this is an octree, etc. The tree is constructed by specifying a region and a tree depth, then calling ConstructTree(). This class was designed for use as a quad/octree binning structure for itkParticleNeighborhood classes.

Public Types Documentation

typedef Self

typedef PowerOfTwoPointTree itk::PowerOfTwoPointTree< VDimension >::Self;

Standard class typedefs

typedef Superclass

typedef DataObject itk::PowerOfTwoPointTree< VDimension >::Superclass;

typedef Pointer

typedef SmartPointer<Self> itk::PowerOfTwoPointTree< VDimension >::Pointer;

typedef ConstPointer

typedef SmartPointer<const Self> itk::PowerOfTwoPointTree< VDimension >::ConstPointer;

typedef ConstWeakPointer

typedef WeakPointer<const Self> itk::PowerOfTwoPointTree< VDimension >::ConstWeakPointer;

typedef NodeType

typedef PowerOfTwoPointTreeNode<VDimension> itk::PowerOfTwoPointTree< VDimension >::NodeType;

Shorthand for the object pointed to by each node.

typedef NodePointerType

typedef NodeType::Pointer itk::PowerOfTwoPointTree< VDimension >::NodePointerType;

The real node type, which is a actually pointer to what we are calling NodeTypes.

typedef PointType

typedef PowerOfTwoPointTreeNode<VDimension>::PointType itk::PowerOfTwoPointTree< VDimension >::PointType;

Point type used by nodes for upper and lower bounds.

typedef PointListType

typedef NodeType::PointListType itk::PowerOfTwoPointTree< VDimension >::PointListType;

Types defined by the NodeType.

typedef PointIteratorListType

typedef std::vector<typename PointListType::const_iterator> itk::PowerOfTwoPointTree< VDimension >::PointIteratorListType;

Public Functions Documentation

function itkNewMacro

itkNewMacro(
    Self 
)

Method for creation through the object factory.

function itkTypeMacro

itkTypeMacro(
    PowerOfTwoPointTree ,
    DataObject 
)

Run-time type information (and related methods).

function itkStaticConstMacro

itkStaticConstMacro(
    Dimension ,
    unsigned int ,
    VDimension 
)

Dimensionality of the domain.

function itkStaticConstMacro

itkStaticConstMacro(
    BranchesPerNode ,
    int ,
    (powstruct< 2, VDimension >::c) 
)

Number of children per node.

function itkGetMacro

itkGetMacro(
    Depth ,
    unsigned int 
)

Set/Get the depth of the tree. This is the number of levels in the tree.

function ConstructTree

void ConstructTree(
    const PointType & ,
    const PointType & ,
    unsigned int 
)

Construct the tree to the specified depth. The bounding box of the root node is specified with the lower bound and upper bound points respectively.

function FindPointsInRegion

PointIteratorListType FindPointsInRegion(
    const PointType & ,
    const PointType & 
) const

Return a list of PointListType iterators (effectively pointers to points, see PowerOfTwoPointTreeNode) to points and their associated indicies that are stored in this tree and are contained within the specified bounding box region. The bounding box is specified with two points, in this order: a lower bound followed by an upper bound.

function FindPointsInRegion

unsigned int FindPointsInRegion(
    const PointType & ,
    const PointType & ,
    PointIteratorListType & 
) const

function GetNode

NodePointerType GetNode(
    const PointType & 
)

Return the node associated with the domain region that contains the given point.

function GetNode

const NodePointerType GetNode(
    const PointType & 
) const

function itkGetObjectMacro

itkGetObjectMacro(
    Root ,
    NodeType 
)

Set/Get the root node of the tree.

function itkSetObjectMacro

itkSetObjectMacro(
    Root ,
    NodeType 
)

function AddPoint

PointListType::iterator AddPoint(
    const PointType & ,
    unsigned int ,
    NodePointerType & 
)

Associates a point and, optionally, an index with the appropriate leaf node. This method starts at the root of the tree and uses the Contains method to query branches at each node, following the first branch it finds whose bounding box contains this point. When it reaches a leaf node, the point is added to that node's list, along with the specified index (if any). This method returns an iterator pointing to the new list element (e.g., for quick deletion or reference of the point) and, optionally, will set a given smart pointer to point to the leaf node. If the specified point is not contained within the domain, then this method will throw an exception.

function AddPoint

inline PointListType::iterator AddPoint(
    const PointType & p,
    unsigned int i
)

function Overlap

bool Overlap(
    const NodePointerType & ,
    const PointType & ,
    const PointType & 
) const

Returns true if the specified node region overlaps the given region and false otherwise.

function RegionContains

inline bool RegionContains(
    const PointType & p,
    const PointType & lowerbound,
    const PointType & upperbound
) const

function PrintSelf

void PrintSelf(
    std::ostream & os,
    Indent indent
) const

Protected Functions Documentation

function PowerOfTwoPointTree

inline PowerOfTwoPointTree()

function ~PowerOfTwoPointTree

inline virtual ~PowerOfTwoPointTree()

function BranchNode

void BranchNode(
    NodePointerType & ,
    unsigned int 
)

Add the appropriate number of empty child nodes to a given node. The second parameter is the level in the tree.

function FindOneNodeInRegion

void FindOneNodeInRegion(
    const NodePointerType & ,
    const PointType & ,
    const PointType & ,
    PointIteratorListType & 
) const

Find one of the nodes that overlaps the specified region and appends all of its points to the specified list. The method is used by FindPointsInRegion and is called recursively.


Updated on 2022-07-23 at 16:40:06 -0600