Package net.imglib2.neighborsearch
Interface KNearestNeighborSearch<T>
- All Superinterfaces:
EuclideanSpace,NearestNeighborSearch<T>
- All Known Implementing Classes:
KNearestNeighborSearchOnIterableRealInterval,KNearestNeighborSearchOnKDTree
k-nearest-neighbor search in an Euclidean space. The interface
describes implementations that perform the search for a specified location
and provide access to the data, location and distance of the found nearest
neighbors until the next search is performed. In a multi-threaded
application, each thread will thus need its own
KNearestNeighborSearch.- Author:
- Stephan Saalfeld
-
Method Summary
Modifier and TypeMethodDescriptioncopy()Create a copy.doublegetDistance(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.intgetK()Get the of k nearest neighbor points used in this searchgetPosition(int i) Access the position of the ith nearest neighbor, ordered by square Euclidean distance.getSampler(int i) Access the data of the ith nearest neighbor, ordered by square Euclidean distance.doublegetSquareDistance(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.voidsearch(RealLocalizable reference) Perform k-nearest-neighbor search for a reference coordinate.Methods inherited from interface net.imglib2.EuclideanSpace
numDimensionsMethods inherited from interface net.imglib2.neighborsearch.NearestNeighborSearch
getDistance, getPosition, getSampler, getSquareDistance
-
Method Details
-
search
Perform k-nearest-neighbor search for a reference coordinate.- Specified by:
searchin interfaceNearestNeighborSearch<T>- Parameters:
reference-
-
getK
int getK()Get the of k nearest neighbor points used in this search- Returns:
- the number of nearest neighbor points k used for this search
-
getSampler
Access the data of the ith nearest neighbor, ordered by square Euclidean distance. Data is accessed through aSamplerthat guarantees write access if the underlying data set is writable. -
getPosition
Access the position of the ith nearest neighbor, ordered by square Euclidean distance. -
getSquareDistance
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. -
getDistance
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. -
copy
KNearestNeighborSearch<T> copy()Create a copy.- Specified by:
copyin interfaceNearestNeighborSearch<T>
-