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.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description KNearestNeighborSearch<T>copy()Create a copy.default 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 searchRealLocalizablegetPosition(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.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
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:
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
Sampler<T> getSampler(int i)
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
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
default 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>
-
-