Package net.imglib2.neighborsearch
Interface KNearestNeighborSearch<T>
-
- All Superinterfaces:
EuclideanSpace
,NearestNeighborSearch<T>
- All Known Implementing Classes:
KNearestNeighborSearchOnIterableRealInterval
,KNearestNeighborSearchOnKDTree
public interface KNearestNeighborSearch<T> extends NearestNeighborSearch<T>
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 ownKNearestNeighborSearch
.- Author:
- Stephan Saalfeld
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description KNearestNeighborSearch<T>
copy()
Create a copy.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 searchRealLocalizable
getPosition(int i)
Access the position of the ith nearest neighbor, ordered by square Euclidean distance.Sampler<T>
getSampler(int i)
Access the data of the ith 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.void
search(RealLocalizable reference)
Perform k-nearest-neighbor search for a reference coordinate.-
Methods inherited from interface net.imglib2.EuclideanSpace
numDimensions
-
Methods inherited from interface net.imglib2.neighborsearch.NearestNeighborSearch
getDistance, getPosition, getSampler, getSquareDistance
-
-
-
-
Method Detail
-
search
void search(RealLocalizable reference)
Perform k-nearest-neighbor search for a reference coordinate.- Specified by:
search
in 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
Sampler<T> getSampler(int i)
Access the data of the ith nearest neighbor, ordered by square Euclidean distance. Data is accessed through aSampler
that guarantees write access if the underlying data set is writable.
-
getPosition
RealLocalizable getPosition(int i)
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:
copy
in interfaceNearestNeighborSearch<T>
-
-