[NOHEADER] |
| int | SearchLoop (KdTreeNodeType *node, MeasurementVectorType &query, MeasurementVectorType &lowerBound, MeasurementVectorType &upperBound) |
Public Types |
| typedef KdTree | Self |
| typedef Object | Superclass |
| typedef SmartPointer< Self > | Pointer |
| 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 |
Public Methods |
| virtual const char * | GetClassName () const |
| | itkStaticConstMacro (MeasurementVectorSize, unsigned int, TSample::MeasurementVectorSize) |
| void | SetBucketSize (unsigned int size) |
| void | SetSample (TSample *sample) |
| TSample * | GetSample () |
| unsigned long | Size () |
| KdTreeNodeType * | GetEmptyTerminalNode () |
| void | SetRoot (KdTreeNodeType *root) |
| KdTreeNodeType * | GetRoot () |
| MeasurementVectorType | GetMeasurementVector (InstanceIdentifier id) |
| FrequencyType | GetFrequency (InstanceIdentifier id) |
| DistanceMetricType * | GetDistanceMetric () |
| void | Search (MeasurementVectorType &query, unsigned int k, InstanceIdentifierVectorType &result) |
| void | Search (MeasurementVectorType &query, double radius, InstanceIdentifierVectorType &result) |
| int | GetNumberOfVisits () |
| bool | BallWithinBounds (MeasurementVectorType &query, MeasurementVectorType &lowerBound, MeasurementVectorType &upperBound, double radius) |
| bool | BoundsOverlapBall (MeasurementVectorType &query, MeasurementVectorType &lowerBound, MeasurementVectorType &upperBound, double radius) |
| void | DeleteNode (KdTreeNodeType *node) |
| void | PrintTree (KdTreeNodeType *node, int level, unsigned int activeDimension) |
| Iterator | Begin () |
| Iterator | End () |
Static Public Methods |
| Pointer | New () |
Protected Methods |
| | KdTree () |
| virtual | ~KdTree () |
| void | PrintSelf (std::ostream &os, Indent indent) const |
| int | NearestNeighborSearchLoop (KdTreeNodeType *node, MeasurementVectorType &query, MeasurementVectorType &lowerBound, MeasurementVectorType &upperBound) |
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.