public class RadiusNeighborSearchOnKDTree<T> extends Object implements RadiusNeighborSearch<T>
RadiusNeighborSearch
search for kd-trees.Modifier and Type | Field and Description |
---|---|
protected int |
n |
protected double[] |
pos |
protected ArrayList<ValuePair<KDTreeNode<T>,Double>> |
resultPoints |
protected KDTree<T> |
tree |
Constructor and Description |
---|
RadiusNeighborSearchOnKDTree(KDTree<T> tree) |
Modifier and Type | Method and Description |
---|---|
double |
getDistance(int i)
Access the Euclidean distance between the reference location as used for
the last search and the ith neighbor.
|
RealLocalizable |
getPosition(int i)
Access the position of the ith neighbor within
radius.
|
Sampler<T> |
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 |
numDimensions()
Gets the space's number of dimensions.
|
int |
numNeighbors()
Get the number of points found within radius after a
RadiusNeighborSearch.search(RealLocalizable, double, boolean) . |
void |
search(RealLocalizable reference,
double radius,
boolean sortResults)
Perform neighbor search within a radius about a reference coordinate.
|
protected void |
searchNode(KDTreeNode<T> current,
double squRadius) |
protected final int n
protected final double[] pos
protected ArrayList<ValuePair<KDTreeNode<T>,Double>> resultPoints
public void search(RealLocalizable reference, double radius, boolean sortResults)
RadiusNeighborSearch
search
in interface RadiusNeighborSearch<T>
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.public int numDimensions()
EuclideanSpace
numDimensions
in interface EuclideanSpace
protected void searchNode(KDTreeNode<T> current, double squRadius)
public int numNeighbors()
RadiusNeighborSearch
RadiusNeighborSearch.search(RealLocalizable, double, boolean)
.numNeighbors
in interface RadiusNeighborSearch<T>
RadiusNeighborSearch.search(RealLocalizable, double, boolean)
.public Sampler<T> getSampler(int i)
RadiusNeighborSearch
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.getSampler
in interface RadiusNeighborSearch<T>
public RealLocalizable getPosition(int i)
RadiusNeighborSearch
sortResults
was set to true, neighbors are ordered by
square Euclidean distance to the reference.getPosition
in interface RadiusNeighborSearch<T>
public double getSquareDistance(int i)
RadiusNeighborSearch
sortResults
was set to true, neighbors are ordered by square
Euclidean distance to the reference.getSquareDistance
in interface RadiusNeighborSearch<T>
public double getDistance(int i)
RadiusNeighborSearch
getDistance
in interface RadiusNeighborSearch<T>
Copyright © 2015–2022 ImgLib2. All rights reserved.