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 java.lang.Object implements NearestNeighborSearch<T>
k-nearest-neighbor search onIterableRealIntervalimplemented as linear search.
-
-
Field Summary
Fields Modifier and Type Field Description protected RealCursor<T>elementprotected IterableRealInterval<T>iterableprotected intnprotected double[]referenceLocationprotected doublesquareDistance
-
Constructor Summary
Constructors Constructor Description NearestNeighborSearchOnIterableRealInterval(IterableRealInterval<T> iterable)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NearestNeighborSearchOnIterableRealInterval<T>copy()Create a copy.doublegetDistance()Access the Euclidean distance between the reference location as used for the last search and the nearest neighbor, ordered by square Euclidean distance.RealLocalizablegetPosition()Access the position of the nearest neighbor, ordered by square Euclidean distance.Sampler<T>getSampler()Access the data of the nearest neighbor.doublegetSquareDistance()Access the square Euclidean distance between the reference location as used for the last search and the nearest neighbor, ordered by square Euclidean distance.intnumDimensions()Gets the space's number of dimensions.voidsearch(RealLocalizable reference)Perform nearest-neighbor search for a reference coordinate.protected doublesquareDistance(RealLocalizable query)Calculate the square Euclidean distance of a query location to the location stored in referenceLocation.
-
-
-
Field Detail
-
iterable
protected final IterableRealInterval<T> iterable
-
n
protected final int n
-
element
protected RealCursor<T> element
-
squareDistance
protected double squareDistance
-
referenceLocation
protected final double[] referenceLocation
-
-
Constructor Detail
-
NearestNeighborSearchOnIterableRealInterval
public NearestNeighborSearchOnIterableRealInterval(IterableRealInterval<T> iterable)
-
-
Method Detail
-
squareDistance
protected final double squareDistance(RealLocalizable query)
Calculate the square Euclidean distance of a query location to the location stored in referenceLocation.
-
numDimensions
public int numDimensions()
Description copied from interface:EuclideanSpaceGets the space's number of dimensions.- Specified by:
numDimensionsin interfaceEuclideanSpace
-
search
public void search(RealLocalizable reference)
Description copied from interface:NearestNeighborSearchPerform nearest-neighbor search for a reference coordinate.- Specified by:
searchin interfaceNearestNeighborSearch<T>
-
getPosition
public RealLocalizable getPosition()
Description copied from interface:NearestNeighborSearchAccess the position of the nearest neighbor, ordered by square Euclidean distance.- Specified by:
getPositionin interfaceNearestNeighborSearch<T>
-
getSampler
public Sampler<T> getSampler()
Description copied from interface:NearestNeighborSearchAccess the data of the nearest neighbor. Data is accessed through aSamplerthat guarantees write access if the underlying data set is writable.- Specified by:
getSamplerin interfaceNearestNeighborSearch<T>
-
getSquareDistance
public double getSquareDistance()
Description copied from interface:NearestNeighborSearchAccess 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:
getSquareDistancein interfaceNearestNeighborSearch<T>
-
getDistance
public double getDistance()
Description copied from interface:NearestNeighborSearchAccess the Euclidean distance between the reference location as used for the last search and the nearest neighbor, ordered by square Euclidean distance.- Specified by:
getDistancein interfaceNearestNeighborSearch<T>
-
copy
public NearestNeighborSearchOnIterableRealInterval<T> copy()
Description copied from interface:NearestNeighborSearchCreate a copy.- Specified by:
copyin interfaceNearestNeighborSearch<T>
-
-