Class RadiusNeighborSearchOnKDTree<T>
java.lang.Object
net.imglib2.neighborsearch.RadiusNeighborSearchOnKDTree<T>
- All Implemented Interfaces:
EuclideanSpace, RadiusNeighborSearch<T>
Implementation of
RadiusNeighborSearch search for kd-trees.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final RadiusNeighborSearchImplprivate final List<KDTreeNode<T>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()Create a copy.private voidfillMatches(int first, int last) 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.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface RadiusNeighborSearch
getDistance
-
Field Details
-
tree
-
impl
-
matches
-
-
Constructor Details
-
RadiusNeighborSearchOnKDTree
-
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.
-
fillMatches
private void fillMatches(int first, int last) -
numDimensions
public int numDimensions()Description copied from interface:EuclideanSpaceGets the space's number of dimensions.- Specified by:
numDimensionsin interfaceEuclideanSpace
-
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>
-
copy
Description copied from interface:RadiusNeighborSearchCreate a copy.- Specified by:
copyin interfaceRadiusNeighborSearch<T>
-