ITK  4.0.0
Insight Segmentation and Registration Toolkit
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
itk::Statistics::KdTreeGenerator< TSample > Class Template Reference

This class generates a KdTree object without centroid information. More...

#include <itkKdTreeGenerator.h>

Inheritance diagram for itk::Statistics::KdTreeGenerator< TSample >:
Collaboration diagram for itk::Statistics::KdTreeGenerator< TSample >:

List of all members.

Public Types

typedef SmartPointer< const SelfConstPointer
typedef KdTreeType::KdTreeNodeType KdTreeNodeType
typedef KdTree< TSample > KdTreeType
typedef TSample::MeasurementType MeasurementType
typedef unsigned int MeasurementVectorSizeType
typedef
TSample::MeasurementVectorType 
MeasurementVectorType
typedef KdTreeType::Pointer OutputPointer
typedef KdTreeType OutputType
typedef SmartPointer< SelfPointer
typedef KdTreeGenerator Self
typedef SubsampleType::Pointer SubsamplePointer
typedef Subsample< TSample > SubsampleType
typedef Object Superclass

Public Member Functions

virtual ::itk::LightObject::Pointer CreateAnother (void) const
void GenerateData ()
virtual unsigned int GetMeasurementVectorSize () const
virtual const char * GetNameOfClass () const
OutputPointer GetOutput ()
void SetBucketSize (unsigned int size)
void SetSample (TSample *sample)
void Update ()

Static Public Member Functions

static Pointer New ()

Protected Member Functions

virtual KdTreeNodeTypeGenerateNonterminalNode (unsigned int beginIndex, unsigned int endIndex, MeasurementVectorType &lowerBound, MeasurementVectorType &upperBound, unsigned int level)
KdTreeNodeTypeGenerateTreeLoop (unsigned int beginIndex, unsigned int endIndex, MeasurementVectorType &lowerBound, MeasurementVectorType &upperBound, unsigned int level)
SubsamplePointer GetSubsample ()
 KdTreeGenerator ()
void PrintSelf (std::ostream &os, Indent indent) const
virtual ~KdTreeGenerator ()

Private Member Functions

 KdTreeGenerator (const Self &)
void operator= (const Self &)

Private Attributes

unsigned int m_BucketSize
MeasurementVectorSizeType m_MeasurementVectorSize
TSample * m_SourceSample
SubsamplePointer m_Subsample
MeasurementVectorType m_TempLowerBound
MeasurementVectorType m_TempMean
MeasurementVectorType m_TempUpperBound
OutputPointer m_Tree

Detailed Description

template<class TSample>
class itk::Statistics::KdTreeGenerator< TSample >

This class generates a KdTree object without centroid information.

The KdTree object stores measurment vectors in a k-d tree structure that is a binary tree. The partition value is the median value of one of the k dimension (partition dimension). The partition dimension is determined by the spread of measurement values in each dimension. The partition dimension is the dimension has the widest spread. Our implementation of k-d tree doesn't have any construction or insertion logic. Users should use this class or the WeightedCentroidKdTreeGenerator class.

The number of the measurement vectors in a terminal node is set by the SetBucketSize method. If we use too small number for this, it might cause computational overhead to calculate bound conditions. However, too large number will cause more distance calculation between the measurement vectors in a terminal node and the query point.

To run this generator, users should provides the bucket size (SetBucketSize method) and the input sample (SetSample method). The Update method will run this generator. To get the resulting KdTree object, call the GetOutput method.

Recent API changes: The static const macro to get the length of a measurement vector, 'MeasurementVectorSize' has been removed to allow the length of a measurement vector to be specified at run time. It is now obtained from the sample set as input. You may query this length using the function GetMeasurementVectorSize().

See also:
KdTree, KdTreeNode, KdTreeNonterminalNode, KdTreeTerminalNode, WeightedCentroidKdTreeGenerator
Wiki Examples:

Definition at line 70 of file itkKdTreeGenerator.h.


Member Typedef Documentation

template<class TSample >
typedef SmartPointer< const Self > itk::Statistics::KdTreeGenerator< TSample >::ConstPointer

Reimplemented from itk::Object.

Reimplemented in itk::Statistics::WeightedCentroidKdTreeGenerator< TSample >.

Definition at line 77 of file itkKdTreeGenerator.h.

template<class TSample >
typedef KdTreeType::KdTreeNodeType itk::Statistics::KdTreeGenerator< TSample >::KdTreeNodeType

Typedef for the k-d tree node type

Reimplemented in itk::Statistics::WeightedCentroidKdTreeGenerator< TSample >.

Definition at line 102 of file itkKdTreeGenerator.h.

template<class TSample >
typedef KdTree< TSample > itk::Statistics::KdTreeGenerator< TSample >::KdTreeType

Typedef for the k-d tree

Reimplemented in itk::Statistics::WeightedCentroidKdTreeGenerator< TSample >.

Definition at line 93 of file itkKdTreeGenerator.h.

template<class TSample >
typedef TSample::MeasurementType itk::Statistics::KdTreeGenerator< TSample >::MeasurementType
template<class TSample >
typedef unsigned int itk::Statistics::KdTreeGenerator< TSample >::MeasurementVectorSizeType

Typedef for the length of each measurement vector

Definition at line 90 of file itkKdTreeGenerator.h.

template<class TSample >
typedef TSample::MeasurementVectorType itk::Statistics::KdTreeGenerator< TSample >::MeasurementVectorType

typedef alias for the source data container

Reimplemented in itk::Statistics::WeightedCentroidKdTreeGenerator< TSample >.

Definition at line 83 of file itkKdTreeGenerator.h.

template<class TSample >
typedef KdTreeType::Pointer itk::Statistics::KdTreeGenerator< TSample >::OutputPointer

Typedef for the smart pointer to the k-d tree

Definition at line 99 of file itkKdTreeGenerator.h.

template<class TSample >
typedef KdTreeType itk::Statistics::KdTreeGenerator< TSample >::OutputType

Type alias for the k-d tree type

Definition at line 96 of file itkKdTreeGenerator.h.

template<class TSample >
typedef SmartPointer< Self > itk::Statistics::KdTreeGenerator< TSample >::Pointer

Reimplemented from itk::Object.

Reimplemented in itk::Statistics::WeightedCentroidKdTreeGenerator< TSample >.

Definition at line 76 of file itkKdTreeGenerator.h.

template<class TSample >
typedef KdTreeGenerator itk::Statistics::KdTreeGenerator< TSample >::Self

Standard class typedefs

Reimplemented from itk::Object.

Reimplemented in itk::Statistics::WeightedCentroidKdTreeGenerator< TSample >.

Definition at line 74 of file itkKdTreeGenerator.h.

template<class TSample >
typedef SubsampleType::Pointer itk::Statistics::KdTreeGenerator< TSample >::SubsamplePointer

Typedef for the smart pointer to the Subsample

Reimplemented in itk::Statistics::WeightedCentroidKdTreeGenerator< TSample >.

Definition at line 108 of file itkKdTreeGenerator.h.

template<class TSample >
typedef Subsample< TSample > itk::Statistics::KdTreeGenerator< TSample >::SubsampleType

Typedef for the internal Subsample

Reimplemented in itk::Statistics::WeightedCentroidKdTreeGenerator< TSample >.

Definition at line 105 of file itkKdTreeGenerator.h.

template<class TSample >
typedef Object itk::Statistics::KdTreeGenerator< TSample >::Superclass

Reimplemented from itk::Object.

Reimplemented in itk::Statistics::WeightedCentroidKdTreeGenerator< TSample >.

Definition at line 75 of file itkKdTreeGenerator.h.


Constructor & Destructor Documentation

template<class TSample >
itk::Statistics::KdTreeGenerator< TSample >::KdTreeGenerator ( ) [protected]

Constructor

template<class TSample >
virtual itk::Statistics::KdTreeGenerator< TSample >::~KdTreeGenerator ( ) [inline, protected, virtual]

Destructor

Definition at line 141 of file itkKdTreeGenerator.h.

template<class TSample >
itk::Statistics::KdTreeGenerator< TSample >::KdTreeGenerator ( const Self ) [private]

Member Function Documentation

template<class TSample >
virtual::itk::LightObject::Pointer itk::Statistics::KdTreeGenerator< TSample >::CreateAnother ( void  ) const [virtual]

Create an object from an instance, potentially deferring to a factory. This method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.

Reimplemented from itk::Object.

Reimplemented in itk::Statistics::WeightedCentroidKdTreeGenerator< TSample >.

template<class TSample >
void itk::Statistics::KdTreeGenerator< TSample >::GenerateData ( )

Runs this k-d tree construction algorithm.

template<class TSample >
virtual KdTreeNodeType* itk::Statistics::KdTreeGenerator< TSample >::GenerateNonterminalNode ( unsigned int  beginIndex,
unsigned int  endIndex,
MeasurementVectorType lowerBound,
MeasurementVectorType upperBound,
unsigned int  level 
) [protected, virtual]

Nonterminal node generation routine

Reimplemented in itk::Statistics::WeightedCentroidKdTreeGenerator< TSample >.

template<class TSample >
KdTreeNodeType* itk::Statistics::KdTreeGenerator< TSample >::GenerateTreeLoop ( unsigned int  beginIndex,
unsigned int  endIndex,
MeasurementVectorType lowerBound,
MeasurementVectorType upperBound,
unsigned int  level 
) [protected]

Tree generation loop

template<class TSample >
virtual unsigned int itk::Statistics::KdTreeGenerator< TSample >::GetMeasurementVectorSize ( ) const [virtual]

Get macro to get the length of the measurement vectors that are being held in the 'sample' that is passed to this class

template<class TSample >
virtual const char* itk::Statistics::KdTreeGenerator< TSample >::GetNameOfClass ( ) const [virtual]

Run-time type information (and related methods)

Reimplemented from itk::Object.

Reimplemented in itk::Statistics::WeightedCentroidKdTreeGenerator< TSample >.

template<class TSample >
OutputPointer itk::Statistics::KdTreeGenerator< TSample >::GetOutput ( void  ) [inline]

Returns the pointer to the generated k-d tree.

Definition at line 118 of file itkKdTreeGenerator.h.

template<class TSample >
SubsamplePointer itk::Statistics::KdTreeGenerator< TSample >::GetSubsample ( ) [inline, protected]

Returns the smart pointer to the internal Subsample object.

Definition at line 146 of file itkKdTreeGenerator.h.

template<class TSample >
static Pointer itk::Statistics::KdTreeGenerator< TSample >::New ( ) [static]

Method for creation through the object factory.

Reimplemented from itk::Object.

Reimplemented in itk::Statistics::WeightedCentroidKdTreeGenerator< TSample >.

template<class TSample >
void itk::Statistics::KdTreeGenerator< TSample >::operator= ( const Self ) [private]

Mutex lock to protect modification to the reference count

Reimplemented from itk::Object.

Reimplemented in itk::Statistics::WeightedCentroidKdTreeGenerator< TSample >.

template<class TSample >
void itk::Statistics::KdTreeGenerator< TSample >::PrintSelf ( std::ostream &  os,
Indent  indent 
) const [protected, virtual]

Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from itk::Object.

Reimplemented in itk::Statistics::WeightedCentroidKdTreeGenerator< TSample >.

template<class TSample >
void itk::Statistics::KdTreeGenerator< TSample >::SetBucketSize ( unsigned int  size)

Sets the number of measurement vectors that can be stored in a terminal node.

template<class TSample >
void itk::Statistics::KdTreeGenerator< TSample >::SetSample ( TSample *  sample)

Sets the input sample that provides the measurement vectors.

template<class TSample >
void itk::Statistics::KdTreeGenerator< TSample >::Update ( void  ) [inline]

Runs this k-d tree construction algorithm.

Definition at line 124 of file itkKdTreeGenerator.h.


Member Data Documentation

template<class TSample >
unsigned int itk::Statistics::KdTreeGenerator< TSample >::m_BucketSize [private]

The number of measurement vectors that can be stored in a terminal node.

Definition at line 180 of file itkKdTreeGenerator.h.

Length of a measurement vector

Definition at line 195 of file itkKdTreeGenerator.h.

template<class TSample >
TSample* itk::Statistics::KdTreeGenerator< TSample >::m_SourceSample [private]

Pointer to the input (source) sample

Definition at line 171 of file itkKdTreeGenerator.h.

template<class TSample >
SubsamplePointer itk::Statistics::KdTreeGenerator< TSample >::m_Subsample [private]

Smart pointer to the internal Subsample object. This class needs a Subsample object because the partitioning process involves sorting and selection.

Definition at line 176 of file itkKdTreeGenerator.h.

template<class TSample >
MeasurementVectorType itk::Statistics::KdTreeGenerator< TSample >::m_TempLowerBound [private]

Temporary lower bound for the TreeGenerationLoop

Reimplemented in itk::Statistics::WeightedCentroidKdTreeGenerator< TSample >.

Definition at line 186 of file itkKdTreeGenerator.h.

template<class TSample >
MeasurementVectorType itk::Statistics::KdTreeGenerator< TSample >::m_TempMean [private]

Temporary mean for the TreeGenerationLoop

Reimplemented in itk::Statistics::WeightedCentroidKdTreeGenerator< TSample >.

Definition at line 192 of file itkKdTreeGenerator.h.

template<class TSample >
MeasurementVectorType itk::Statistics::KdTreeGenerator< TSample >::m_TempUpperBound [private]

Temporary upper bound for the TreeGenerationLoop

Reimplemented in itk::Statistics::WeightedCentroidKdTreeGenerator< TSample >.

Definition at line 189 of file itkKdTreeGenerator.h.

template<class TSample >
OutputPointer itk::Statistics::KdTreeGenerator< TSample >::m_Tree [private]

Pointer to the resulting k-d tree.

Definition at line 183 of file itkKdTreeGenerator.h.


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