Package net.imglib2.neighborsearch
Class RadiusNeighborSearchOnKDTree<T>
java.lang.Object
net.imglib2.neighborsearch.RadiusNeighborSearchOnKDTree<T>
- All Implemented Interfaces:
EuclideanSpace,RadiusNeighborSearch<T>
Implementation of
RadiusNeighborSearch search for kd-trees.- Author:
- Tobias Pietzsch
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublegetDistance(int i) Access the Euclidean distance between the reference location as used for the last search and the ith neighbor.getPosition(int i) Access the position of the ith neighbor within radius.getSampler(int i) Access the data of the ith neighbor within radius.doublegetSquareDistance(int i) Access the square Euclidean distance between the reference location as used for the last search and the ith neighbor.intGets the space's number of dimensions.intGet the number of points found within radius after aRadiusNeighborSearch.search(RealLocalizable, double, boolean).voidsearch(RealLocalizable reference, double radius, boolean sortResults) Perform neighbor search within a radius about a reference coordinate.protected voidsearchNode(KDTreeNode<T> current, double squRadius)
-
Field Details
-
tree
-
n
protected final int n -
pos
protected final double[] pos -
resultPoints
-
-
Constructor Details
-
RadiusNeighborSearchOnKDTree
-
-
Method Details
-
search
Description copied from interface:RadiusNeighborSearchPerform 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:
searchin interfaceRadiusNeighborSearch<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:EuclideanSpaceGets the space's number of dimensions.- Specified by:
numDimensionsin interfaceEuclideanSpace
-
searchNode
-
numNeighbors
public int numNeighbors()Description copied from interface:RadiusNeighborSearchGet the number of points found within radius after aRadiusNeighborSearch.search(RealLocalizable, double, boolean).- Specified by:
numNeighborsin interfaceRadiusNeighborSearch<T>- Returns:
- the number of points found within radius after a
RadiusNeighborSearch.search(RealLocalizable, double, boolean).
-
getSampler
Description copied from interface:RadiusNeighborSearchAccess the data of the ith neighbor within radius. IfsortResultswas set to true, neighbors are ordered by square Euclidean distance to the reference. Data is accessed through aSamplerthat guarantees write access if the underlying data set is writable.- Specified by:
getSamplerin interfaceRadiusNeighborSearch<T>
-
getPosition
Description copied from interface:RadiusNeighborSearchAccess the position of the ith neighbor within radius. IfsortResultswas set to true, neighbors are ordered by square Euclidean distance to the reference.- Specified by:
getPositionin interfaceRadiusNeighborSearch<T>
-
getSquareDistance
public double getSquareDistance(int i) Description copied from interface:RadiusNeighborSearchAccess the square Euclidean distance between the reference location as used for the last search and the ith neighbor. IfsortResultswas set to true, neighbors are ordered by square Euclidean distance to the reference.- Specified by:
getSquareDistancein interfaceRadiusNeighborSearch<T>
-
getDistance
public double getDistance(int i) Description copied from interface:RadiusNeighborSearchAccess the Euclidean distance between the reference location as used for the last search and the ith neighbor.- Specified by:
getDistancein interfaceRadiusNeighborSearch<T>
-