Package net.imglib2.neighborsearch
Class NearestNeighborSearchOnKDTree<T>
- java.lang.Object
-
- net.imglib2.neighborsearch.NearestNeighborSearchOnKDTree<T>
-
- All Implemented Interfaces:
EuclideanSpace,NearestNeighborSearch<T>
public class NearestNeighborSearchOnKDTree<T> extends java.lang.Object implements NearestNeighborSearch<T>
Implementation ofNearestNeighborSearchsearch for kd-trees.
-
-
Field Summary
Fields Modifier and Type Field Description private KDTreeNode<T>bestPointprivate NearestNeighborSearchImplimplprivate KDTree<T>tree
-
Constructor Summary
Constructors Modifier Constructor Description NearestNeighborSearchOnKDTree(KDTree<T> tree)privateNearestNeighborSearchOnKDTree(NearestNeighborSearchOnKDTree<T> nn)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NearestNeighborSearchOnKDTree<T>copy()Create a copy.RealLocalizablegetPosition()Access the position of the nearest neighbor, ordered by square Euclidean distance.Sampler<T>getSampler()Access the data of the nearest neighbor.doublegetSquareDistance()Access the square Euclidean distance between the reference location as used for the last search and the nearest neighbor, ordered by square Euclidean distance.intnumDimensions()Gets the space's number of dimensions.voidsearch(RealLocalizable p)Perform nearest-neighbor search for a reference coordinate.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.imglib2.neighborsearch.NearestNeighborSearch
getDistance
-
-
-
-
Field Detail
-
impl
private final NearestNeighborSearchImpl impl
-
bestPoint
private final KDTreeNode<T> bestPoint
-
-
Constructor Detail
-
NearestNeighborSearchOnKDTree
private NearestNeighborSearchOnKDTree(NearestNeighborSearchOnKDTree<T> nn)
-
-
Method Detail
-
numDimensions
public int numDimensions()
Description copied from interface:EuclideanSpaceGets the space's number of dimensions.- Specified by:
numDimensionsin interfaceEuclideanSpace
-
search
public void search(RealLocalizable p)
Description copied from interface:NearestNeighborSearchPerform nearest-neighbor search for a reference coordinate.- Specified by:
searchin interfaceNearestNeighborSearch<T>
-
getSampler
public Sampler<T> getSampler()
Description copied from interface:NearestNeighborSearchAccess the data of the nearest neighbor. Data is accessed through aSamplerthat guarantees write access if the underlying data set is writable.- Specified by:
getSamplerin interfaceNearestNeighborSearch<T>
-
getPosition
public RealLocalizable getPosition()
Description copied from interface:NearestNeighborSearchAccess the position of the nearest neighbor, ordered by square Euclidean distance.- Specified by:
getPositionin interfaceNearestNeighborSearch<T>
-
getSquareDistance
public double getSquareDistance()
Description copied from interface:NearestNeighborSearchAccess the square Euclidean distance between the reference location as used for the last search and the nearest neighbor, ordered by square Euclidean distance.- Specified by:
getSquareDistancein interfaceNearestNeighborSearch<T>
-
copy
public NearestNeighborSearchOnKDTree<T> copy()
Description copied from interface:NearestNeighborSearchCreate a copy.- Specified by:
copyin interfaceNearestNeighborSearch<T>
-
-