Package net.imglib2.neighborsearch
Interface RadiusNeighborSearch<T>
- All Superinterfaces:
EuclideanSpace
- All Known Implementing Classes:
RadiusNeighborSearchOnKDTree
Radius neighbor search in an Euclidean space. The interface describes
implementations that perform the search for a specified reference location
and radius, and provide access to the data, location, and distance of the
found neighbors until the next search is performed. For every search, the
user can choose whether the found neighbors are returned in arbitrary order
or sorted by distance to the reference location.
In a multi-threaded application, each thread will need its own
RadiusNeighborSearch
.- Author:
- Tobias Pietzsch
-
Method Summary
Modifier and TypeMethodDescriptiondouble
getDistance
(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.double
getSquareDistance
(int i) Access the square Euclidean distance between the reference location as used for the last search and the ith neighbor.int
Get the number of points found within radius after asearch(RealLocalizable, double, boolean)
.void
search
(RealLocalizable reference, double radius, boolean sortResults) Perform neighbor search within a radius about a reference coordinate.Methods inherited from interface net.imglib2.EuclideanSpace
numDimensions
-
Method Details
-
search
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.- 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.
-
numNeighbors
int numNeighbors()Get the number of points found within radius after asearch(RealLocalizable, double, boolean)
.- Returns:
- the number of points found within radius after a
search(RealLocalizable, double, boolean)
.
-
getSampler
Access the data of the ith neighbor within radius. IfsortResults
was set to true, neighbors are ordered by square Euclidean distance to the reference. Data is accessed through aSampler
that guarantees write access if the underlying data set is writable. -
getPosition
Access the position of the ith neighbor within radius. IfsortResults
was set to true, neighbors are ordered by square Euclidean distance to the reference. -
getSquareDistance
double getSquareDistance(int i) Access the square Euclidean distance between the reference location as used for the last search and the ith neighbor. IfsortResults
was set to true, neighbors are ordered by square Euclidean distance to the reference. -
getDistance
double getDistance(int i) Access the Euclidean distance between the reference location as used for the last search and the ith neighbor.
-