public class NearestNeighborSearchOnIterableRealInterval<T> extends Object implements NearestNeighborSearch<T>
IterableRealInterval
implemented as linear search.Modifier and Type | Field and Description |
---|---|
protected RealCursor<T> |
element |
protected IterableRealInterval<T> |
iterable |
protected int |
n |
protected double[] |
referenceLocation |
protected double |
squareDistance |
Constructor and Description |
---|
NearestNeighborSearchOnIterableRealInterval(IterableRealInterval<T> iterable) |
Modifier and Type | Method and Description |
---|---|
NearestNeighborSearchOnIterableRealInterval<T> |
copy()
Create a copy.
|
double |
getDistance()
Access the Euclidean distance between the reference location as used for
the last search and the nearest neighbor, ordered by square Euclidean
distance.
|
RealLocalizable |
getPosition()
Access the position of the nearest neighbor, ordered by square Euclidean
distance.
|
Sampler<T> |
getSampler()
Access the data of the nearest neighbor.
|
double |
getSquareDistance()
Access the square Euclidean distance between the reference location as
used for the last search and the nearest neighbor, ordered by square
Euclidean distance.
|
int |
numDimensions()
Gets the space's number of dimensions.
|
void |
search(RealLocalizable reference)
Perform nearest-neighbor search for a reference coordinate.
|
protected double |
squareDistance(RealLocalizable query)
Calculate the square Euclidean distance of a query location to the
location stored in referenceLocation.
|
protected final IterableRealInterval<T> iterable
protected final int n
protected RealCursor<T> element
protected double squareDistance
protected final double[] referenceLocation
public NearestNeighborSearchOnIterableRealInterval(IterableRealInterval<T> iterable)
protected final double squareDistance(RealLocalizable query)
public int numDimensions()
EuclideanSpace
numDimensions
in interface EuclideanSpace
public void search(RealLocalizable reference)
NearestNeighborSearch
search
in interface NearestNeighborSearch<T>
public RealLocalizable getPosition()
NearestNeighborSearch
getPosition
in interface NearestNeighborSearch<T>
public Sampler<T> getSampler()
NearestNeighborSearch
Sampler
that guarantees write access if the underlying data set
is writable.getSampler
in interface NearestNeighborSearch<T>
public double getSquareDistance()
NearestNeighborSearch
getSquareDistance
in interface NearestNeighborSearch<T>
public double getDistance()
NearestNeighborSearch
getDistance
in interface NearestNeighborSearch<T>
public NearestNeighborSearchOnIterableRealInterval<T> copy()
NearestNeighborSearch
copy
in interface NearestNeighborSearch<T>
Copyright © 2015–2022 ImgLib2. All rights reserved.