#include <itkKdTree.h>
Inheritance diagram for itk::Statistics::KdTree< TSample >:
[NOHEADER] | |
int | SearchLoop (const KdTreeNodeType *node, MeasurementVectorType &query, MeasurementVectorType &lowerBound, MeasurementVectorType &upperBound) const |
Public Types | |
typedef KdTree | Self |
typedef Object | Superclass |
typedef SmartPointer< Self > | Pointer |
typedef SmartPointer< const Self > | ConstPointer |
typedef TSample | SampleType |
typedef TSample::MeasurementVectorType | MeasurementVectorType |
typedef TSample::MeasurementType | MeasurementType |
typedef TSample::InstanceIdentifier | InstanceIdentifier |
typedef TSample::FrequencyType | FrequencyType |
typedef EuclideanDistance< MeasurementVectorType > | DistanceMetricType |
typedef KdTreeNode< TSample > | KdTreeNodeType |
typedef std::pair< InstanceIdentifier, double > | NeighborType |
typedef std::vector< InstanceIdentifier > | InstanceIdentifierVectorType |
typedef TSample::Iterator | Iterator |
typedef TSample::ConstIterator | ConstIterator |
Public Member Functions | |
virtual const char * | GetClassName () const |
itkStaticConstMacro (MeasurementVectorSize, unsigned int, TSample::MeasurementVectorSize) | |
void | SetBucketSize (unsigned int size) |
void | SetSample (const TSample *sample) |
const TSample * | GetSample () const |
unsigned long | Size () const |
KdTreeNodeType * | GetEmptyTerminalNode () |
void | SetRoot (KdTreeNodeType *root) |
KdTreeNodeType * | GetRoot () |
const MeasurementVectorType & | GetMeasurementVector (InstanceIdentifier id) const |
FrequencyType | GetFrequency (InstanceIdentifier id) const |
DistanceMetricType * | GetDistanceMetric () |
void | Search (MeasurementVectorType &query, unsigned int k, InstanceIdentifierVectorType &result) const |
void | Search (MeasurementVectorType &query, double radius, InstanceIdentifierVectorType &result) const |
int | GetNumberOfVisits () const |
bool | BallWithinBounds (MeasurementVectorType &query, MeasurementVectorType &lowerBound, MeasurementVectorType &upperBound, double radius) const |
bool | BoundsOverlapBall (MeasurementVectorType &query, MeasurementVectorType &lowerBound, MeasurementVectorType &upperBound, double radius) const |
void | DeleteNode (KdTreeNodeType *node) |
void | PrintTree (KdTreeNodeType *node, int level, unsigned int activeDimension) |
Iterator | Begin () |
Iterator | End () |
ConstIterator | Begin () const |
ConstIterator | End () const |
Static Public Member Functions | |
Pointer | New () |
Protected Member Functions | |
KdTree () | |
virtual | ~KdTree () |
void | PrintSelf (std::ostream &os, Indent indent) const |
int | NearestNeighborSearchLoop (const KdTreeNodeType *node, MeasurementVectorType &query, MeasurementVectorType &lowerBound, MeasurementVectorType &upperBound) const |
An object of this class stores instance identifiers in a k-d tree that is a binary tree with childrens split along a dimension among k-dimensions. The dimension of the split (or partition) is determined for each nonterminal node that has two children. The split process is terminated when the node has no children (when the number of measurement vectors is less than or equal to the size set by the SetBucketSize. That is The split process is a recursive process in nature and in implementation. This implementation doesn't support dynamic insert and delete operations for the tree. Instead, we can use the KdTreeGenerator or WeightedCentroidKdTreeGenerator to generate a static KdTree object.
To search k-nearest neighbor, call the Search method with the query point in a k-d space and the number of nearest neighbors. The GetSearchResult method returns a pointer to a NearestNeighbors object with k-nearest neighbors.
Definition at line 346 of file itkKdTree.h.
|
Definition at line 549 of file itkKdTree.h. |
|
Reimplemented from itk::Object. Definition at line 353 of file itkKdTree.h. |
|
DistanceMetric type for the distance calculation and comparison Definition at line 373 of file itkKdTree.h. Referenced by itk::Statistics::KdTree< TSample >::GetFrequency(). |
|
Definition at line 366 of file itkKdTree.h. |
|
Definition at line 365 of file itkKdTree.h. |
|
Definition at line 383 of file itkKdTree.h. Referenced by itk::Statistics::KdTree< TSample >::GetDistanceMetric(). |
|
Definition at line 548 of file itkKdTree.h. |
|
Node type of the KdTree Definition at line 376 of file itkKdTree.h. Referenced by itk::Statistics::KdTree< TSample >::SetRoot(). |
|
Definition at line 364 of file itkKdTree.h. |
|
Definition at line 363 of file itkKdTree.h. Referenced by itk::Statistics::KdTree< TSample >::GetDistanceMetric(). |
|
Neighbor type. The first element of the std::pair is the instance identifier and the second one is the distance between the measurement vector identified by the first element and the query point. Definition at line 381 of file itkKdTree.h. |
|
Reimplemented from itk::Object. Definition at line 352 of file itkKdTree.h. |
|
typedef alias for the source data container Definition at line 362 of file itkKdTree.h. |
|
Standard class typedefs Reimplemented from itk::Object. Definition at line 350 of file itkKdTree.h. |
|
Reimplemented from itk::Object. Definition at line 351 of file itkKdTree.h. |
|
Constructor |
|
Destructor: deletes the root node and the empty terminal node. |
|
Returns true if the intermediate k-nearest neighbors exist within the the bounding box defined by the lowerBound and the upperBound. Otherwise returns false. Returns false if the ball defined by the distance between the query point and the farthest neighbor touch the surface of the bounding box. |
|
Definition at line 563 of file itkKdTree.h. |
|
Definition at line 551 of file itkKdTree.h. |
|
Returns true if the ball defined by the distance between the query point and the farthest neighbor overlaps with the bounding box defined by the lower and the upper bounds. |
|
Deletes the node recursively |
|
Definition at line 569 of file itkKdTree.h. |
|
Definition at line 557 of file itkKdTree.h. |
|
Run-time type information (and related methods) Reimplemented from itk::Object.
|
|
Get the pointer to the distance metric. Definition at line 505 of file itkKdTree.h. References itk::Statistics::KdTree< TSample >::InstanceIdentifierVectorType, and itk::Statistics::KdTree< TSample >::MeasurementVectorType. |
|
Returns the pointer to the empty terminal node. A KdTree object has a single empty terminal node in memory. when the split process has to create an empty terminal node, the single instance is reused for this case Definition at line 482 of file itkKdTree.h. |
|
Returns the frequency of the measurement vector identified by the instance identifier Definition at line 501 of file itkKdTree.h. References itk::Statistics::KdTree< TSample >::DistanceMetricType. |
|
Returns the measurement vector identified by the instance identifier that is an identifier defiend for the input sample Definition at line 496 of file itkKdTree.h. |
|
Returns the number of measurement vectors that have been visited to find the k-nearest neighbors. Definition at line 520 of file itkKdTree.h. |
|
Returns the pointer to the root node. Definition at line 491 of file itkKdTree.h. |
|
Returns the pointer to the input sample Definition at line 472 of file itkKdTree.h. |
|
Length of the measurement vector. k in the k-d tree |
|
search loop |
|
Method for creation through the object factory. Reimplemented from itk::Object.
|
|
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.
|
|
Prints out the tree information |
|
Searches the neighbors fallen into a hypersphere |
|
Searches the k-nearest neighbors |
|
search loop |
|
Sets the number of measurement vectors that can be stored in a terminal node |
|
Sets the root node of the KdTree that is a result of KdTreeGenerator or WeightedCentroidKdTreeGenerator. Definition at line 487 of file itkKdTree.h. References itk::Statistics::KdTree< TSample >::KdTreeNodeType. |
|
Sets the input sample that provides the measurement vectors to the k-d tree |
|
Definition at line 475 of file itkKdTree.h. |