public class KNearestNeighborSearchOnKDTree<T> extends Object implements KNearestNeighborSearch<T>
KNearestNeighborSearch search for kd-trees.| Modifier and Type | Field and Description |
|---|---|
protected KDTreeNode<T>[] |
bestPoints |
protected double[] |
bestSquDistances |
protected int |
k |
protected int |
n |
protected double[] |
pos |
protected KDTree<T> |
tree |
| Constructor and Description |
|---|
KNearestNeighborSearchOnKDTree(KDTree<T> tree,
int k) |
| Modifier and Type | Method and Description |
|---|---|
KNearestNeighborSearchOnKDTree<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.
|
double |
getDistance(int i)
Access the Euclidean distance between the reference location as used for
the last search and the ith nearest neighbor, ordered
by square Euclidean distance.
|
int |
getK()
Get the of k nearest neighbor points used in this search
|
RealLocalizable |
getPosition()
Access the position of the nearest neighbor, ordered by square Euclidean
distance.
|
RealLocalizable |
getPosition(int i)
Access the position of the ith nearest neighbor,
ordered by square Euclidean distance.
|
Sampler<T> |
getSampler()
Access the data of the nearest neighbor.
|
Sampler<T> |
getSampler(int i)
Access the data of the ith nearest neighbor, ordered
by square Euclidean distance.
|
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.
|
double |
getSquareDistance(int i)
Access the square Euclidean distance between the reference location as
used for the last search and the ith nearest
neighbor, ordered by square Euclidean distance.
|
int |
numDimensions()
Gets the space's number of dimensions.
|
void |
search(RealLocalizable reference)
Perform k-nearest-neighbor search for a reference coordinate.
|
protected void |
searchNode(KDTreeNode<T> current) |
protected final int n
protected final double[] pos
protected final int k
protected KDTreeNode<T>[] bestPoints
protected double[] bestSquDistances
public int numDimensions()
EuclideanSpacenumDimensions in interface EuclideanSpacepublic int getK()
KNearestNeighborSearchgetK in interface KNearestNeighborSearch<T>public void search(RealLocalizable reference)
KNearestNeighborSearchsearch in interface KNearestNeighborSearch<T>search in interface NearestNeighborSearch<T>protected void searchNode(KDTreeNode<T> current)
public Sampler<T> getSampler(int i)
KNearestNeighborSearchSampler
that guarantees write access if the underlying data set is writable.getSampler in interface KNearestNeighborSearch<T>public RealLocalizable getPosition(int i)
KNearestNeighborSearchgetPosition in interface KNearestNeighborSearch<T>public double getSquareDistance(int i)
KNearestNeighborSearchgetSquareDistance in interface KNearestNeighborSearch<T>public double getDistance(int i)
KNearestNeighborSearchgetDistance in interface KNearestNeighborSearch<T>public RealLocalizable getPosition()
NearestNeighborSearchgetPosition in interface NearestNeighborSearch<T>public Sampler<T> getSampler()
NearestNeighborSearchSampler that guarantees write access if the underlying data set
is writable.getSampler in interface NearestNeighborSearch<T>public double getSquareDistance()
NearestNeighborSearchgetSquareDistance in interface NearestNeighborSearch<T>public double getDistance()
NearestNeighborSearchgetDistance in interface NearestNeighborSearch<T>public KNearestNeighborSearchOnKDTree<T> copy()
KNearestNeighborSearchcopy in interface KNearestNeighborSearch<T>copy in interface NearestNeighborSearch<T>Copyright © 2015–2022 ImgLib2. All rights reserved.