public class NearestNeighborSearchOnKDTree<T> extends Object implements NearestNeighborSearch<T>
NearestNeighborSearch
search for kd-trees.Modifier and Type | Field and Description |
---|---|
protected KDTreeNode<T> |
bestPoint |
protected double |
bestSquDistance |
protected int |
n |
protected double[] |
pos |
protected KDTree<T> |
tree |
Constructor and Description |
---|
NearestNeighborSearchOnKDTree(KDTree<T> tree) |
Modifier and Type | Method and Description |
---|---|
NearestNeighborSearchOnKDTree<T> |
copy()
Create a copy.
|
double |
getDistance()
Access the Euclidean distance between the reference location as used for
the last search and the nearest neighbor, ordered by square Euclidean
distance.
|
RealLocalizable |
getPosition()
Access the position of the nearest neighbor, ordered by square Euclidean
distance.
|
Sampler<T> |
getSampler()
Access the data of the nearest neighbor.
|
double |
getSquareDistance()
Access the square Euclidean distance between the reference location as
used for the last search and the nearest neighbor, ordered by square
Euclidean distance.
|
int |
numDimensions()
Gets the space's number of dimensions.
|
void |
search(RealLocalizable p)
Perform nearest-neighbor search for a reference coordinate.
|
protected void |
searchNode(KDTreeNode<T> current) |
protected final int n
protected final double[] pos
protected KDTreeNode<T> bestPoint
protected double bestSquDistance
public int numDimensions()
EuclideanSpace
numDimensions
in interface EuclideanSpace
public void search(RealLocalizable p)
NearestNeighborSearch
search
in interface NearestNeighborSearch<T>
protected void searchNode(KDTreeNode<T> current)
public Sampler<T> getSampler()
NearestNeighborSearch
Sampler
that guarantees write access if the underlying data set
is writable.getSampler
in interface NearestNeighborSearch<T>
public RealLocalizable getPosition()
NearestNeighborSearch
getPosition
in interface NearestNeighborSearch<T>
public double getSquareDistance()
NearestNeighborSearch
getSquareDistance
in interface NearestNeighborSearch<T>
public double getDistance()
NearestNeighborSearch
getDistance
in interface NearestNeighborSearch<T>
public NearestNeighborSearchOnKDTree<T> copy()
NearestNeighborSearch
copy
in interface NearestNeighborSearch<T>
Copyright © 2015–2022 ImgLib2. All rights reserved.