Package net.imglib2.neighborsearch
Class NearestNeighborSearchOnIterableRealInterval<T>
java.lang.Object
net.imglib2.neighborsearch.NearestNeighborSearchOnIterableRealInterval<T>
- All Implemented Interfaces:
EuclideanSpace
,NearestNeighborSearch<T>
public class NearestNeighborSearchOnIterableRealInterval<T>
extends Object
implements NearestNeighborSearch<T>
k-nearest-neighbor search on
IterableRealInterval
implemented as linear search.- Author:
- Stephan Saalfeld
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected RealCursor
<T> protected final IterableRealInterval
<T> protected final int
protected final double[]
protected double
-
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptioncopy()
Create a copy.double
Access the Euclidean distance between the reference location as used for the last search and the nearest neighbor, ordered by square Euclidean distance.Access the position of the nearest neighbor, ordered by square Euclidean distance.Access the data of the nearest neighbor.double
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
Gets the space's number of dimensions.void
search
(RealLocalizable reference) Perform nearest-neighbor search for a reference coordinate.protected final double
squareDistance
(RealLocalizable query) Calculate the square Euclidean distance of a query location to the location stored in referenceLocation.
-
Field Details
-
iterable
-
n
protected final int n -
element
-
squareDistance
protected double squareDistance -
referenceLocation
protected final double[] referenceLocation
-
-
Constructor Details
-
NearestNeighborSearchOnIterableRealInterval
-
-
Method Details
-
squareDistance
Calculate the square Euclidean distance of a query location to the location stored in referenceLocation. -
numDimensions
public int numDimensions()Description copied from interface:EuclideanSpace
Gets the space's number of dimensions.- Specified by:
numDimensions
in interfaceEuclideanSpace
-
search
Description copied from interface:NearestNeighborSearch
Perform nearest-neighbor search for a reference coordinate.- Specified by:
search
in interfaceNearestNeighborSearch<T>
- Parameters:
reference
-
-
getPosition
Description copied from interface:NearestNeighborSearch
Access the position of the nearest neighbor, ordered by square Euclidean distance.- Specified by:
getPosition
in interfaceNearestNeighborSearch<T>
-
getSampler
Description copied from interface:NearestNeighborSearch
Access the data of the nearest neighbor. Data is accessed through aSampler
that guarantees write access if the underlying data set is writable.- Specified by:
getSampler
in interfaceNearestNeighborSearch<T>
-
getSquareDistance
public double getSquareDistance()Description copied from interface:NearestNeighborSearch
Access the square Euclidean distance between the reference location as used for the last search and the nearest neighbor, ordered by square Euclidean distance.- Specified by:
getSquareDistance
in interfaceNearestNeighborSearch<T>
-
getDistance
public double getDistance()Description copied from interface:NearestNeighborSearch
Access the Euclidean distance between the reference location as used for the last search and the nearest neighbor, ordered by square Euclidean distance.- Specified by:
getDistance
in interfaceNearestNeighborSearch<T>
-
copy
Description copied from interface:NearestNeighborSearch
Create a copy.- Specified by:
copy
in interfaceNearestNeighborSearch<T>
-