Class RadiusNeighborSearchOnKDTree<T>

java.lang.Object
net.imglib2.neighborsearch.RadiusNeighborSearchOnKDTree<T>
All Implemented Interfaces:
EuclideanSpace, RadiusNeighborSearch<T>

public class RadiusNeighborSearchOnKDTree<T> extends Object implements RadiusNeighborSearch<T>
Implementation of RadiusNeighborSearch search for kd-trees.
Author:
Tobias Pietzsch
  • Field Details

  • Constructor Details

    • RadiusNeighborSearchOnKDTree

      public RadiusNeighborSearchOnKDTree(KDTree<T> tree)
  • Method Details

    • search

      public void search(RealLocalizable reference, double radius, boolean sortResults)
      Description copied from interface: RadiusNeighborSearch
      Perform neighbor search within a radius about a reference coordinate. A point is considered within radius if its distance to the reference is smaller or equal the radius.
      Specified by:
      search in interface RadiusNeighborSearch<T>
      Parameters:
      reference - the reference coordinate.
      radius - the radius about the reference coordinate that should be searched for neighbors.
      sortResults - whether the results should be ordered by ascending distances to reference.
    • numDimensions

      public int numDimensions()
      Description copied from interface: EuclideanSpace
      Gets the space's number of dimensions.
      Specified by:
      numDimensions in interface EuclideanSpace
    • searchNode

      protected void searchNode(KDTreeNode<T> current, double squRadius)
    • numNeighbors

      public int numNeighbors()
      Description copied from interface: RadiusNeighborSearch
      Get the number of points found within radius after a RadiusNeighborSearch.search(RealLocalizable, double, boolean).
      Specified by:
      numNeighbors in interface RadiusNeighborSearch<T>
      Returns:
      the number of points found within radius after a RadiusNeighborSearch.search(RealLocalizable, double, boolean).
    • getSampler

      public Sampler<T> getSampler(int i)
      Description copied from interface: RadiusNeighborSearch
      Access the data of the ith neighbor within radius. If sortResults was set to true, neighbors are ordered by square Euclidean distance to the reference. Data is accessed through a Sampler that guarantees write access if the underlying data set is writable.
      Specified by:
      getSampler in interface RadiusNeighborSearch<T>
    • getPosition

      public RealLocalizable getPosition(int i)
      Description copied from interface: RadiusNeighborSearch
      Access the position of the ith neighbor within radius. If sortResults was set to true, neighbors are ordered by square Euclidean distance to the reference.
      Specified by:
      getPosition in interface RadiusNeighborSearch<T>
    • getSquareDistance

      public double getSquareDistance(int i)
      Description copied from interface: RadiusNeighborSearch
      Access the square Euclidean distance between the reference location as used for the last search and the ith neighbor. If sortResults was set to true, neighbors are ordered by square Euclidean distance to the reference.
      Specified by:
      getSquareDistance in interface RadiusNeighborSearch<T>
    • getDistance

      public double getDistance(int i)
      Description copied from interface: RadiusNeighborSearch
      Access the Euclidean distance between the reference location as used for the last search and the ith neighbor.
      Specified by:
      getDistance in interface RadiusNeighborSearch<T>