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 own KNearestNeighborSearch.
Author:
Stephan Saalfeld
  • Method Summary

    Modifier and Type
    Method
    Description
    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
    Get the of k nearest neighbor points used in this search
    getPosition(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.
    double
    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
    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 Details

    • search

      void search(RealLocalizable reference)
      Perform k-nearest-neighbor search for a reference coordinate.
      Specified by:
      search in interface NearestNeighborSearch<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 a Sampler 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

      Create a copy.
      Specified by:
      copy in interface NearestNeighborSearch<T>