Class InverseDistanceWeightingInterpolator<T extends RealType<T>>
- java.lang.Object
-
- net.imglib2.AbstractEuclideanSpace
-
- net.imglib2.AbstractRealLocalizable
-
- net.imglib2.RealPoint
-
- net.imglib2.interpolation.neighborsearch.InverseDistanceWeightingInterpolator<T>
-
- Type Parameters:
T-
- All Implemented Interfaces:
EuclideanSpace,Positionable,RealLocalizable,RealPositionable,RealRandomAccess<T>,Sampler<T>,Typed<T>
public class InverseDistanceWeightingInterpolator<T extends RealType<T>> extends RealPoint implements RealRandomAccess<T>
RealRandomAccessto aKNearestNeighborSearchwhose sample value is generated by weighting the k nearest neighbors of a query real coordinate by their inverse distance to an arbitrary power p.
-
-
Field Summary
Fields Modifier and Type Field Description protected static doubleminThreshold(package private) intnumNeighbors(package private) doublep(package private) doublep2protected KNearestNeighborSearch<T>search(package private) Tvalue-
Fields inherited from class net.imglib2.AbstractRealLocalizable
position
-
Fields inherited from class net.imglib2.AbstractEuclideanSpace
n
-
-
Constructor Summary
Constructors Constructor Description InverseDistanceWeightingInterpolator(KNearestNeighborSearch<T> search, double p)Creates a newInverseDistanceWeightingInterpolatorbased on aKNearestNeighborSearch.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected doublecomputeWeight(double squareDistance)InverseDistanceWeightingInterpolator<T>copy()Tget()Access the actual T instance providing access to a pixel, sub-pixel or integral region value theSamplerpoints at.TgetType()Get an instance ofT.-
Methods inherited from class net.imglib2.RealPoint
bck, equals, fwd, hashCode, move, move, move, move, move, move, move, move, move, move, setPosition, setPosition, setPosition, setPosition, setPosition, setPosition, setPosition, setPosition, setPosition, setPosition, toString, wrap
-
Methods inherited from class net.imglib2.AbstractRealLocalizable
getDoublePosition, getFloatPosition, localize, localize
-
Methods inherited from class net.imglib2.AbstractEuclideanSpace
numDimensions
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.imglib2.EuclideanSpace
numDimensions
-
Methods inherited from interface net.imglib2.Positionable
bck, fwd, move, move, move, move, move, setPosition, setPosition, setPosition, setPosition, setPosition
-
Methods inherited from interface net.imglib2.RealLocalizable
getDoublePosition, getFloatPosition, localize, localize, localize, positionAsDoubleArray, positionAsRealPoint
-
Methods inherited from interface net.imglib2.RealPositionable
move, move, move, move, move, setPosition, setPosition, setPosition, setPosition, setPosition
-
Methods inherited from interface net.imglib2.RealRandomAccess
copyRealRandomAccess, setPositionAndGet, setPositionAndGet, setPositionAndGet
-
-
-
-
Field Detail
-
minThreshold
protected static final double minThreshold
- See Also:
- Constant Field Values
-
search
protected final KNearestNeighborSearch<T extends RealType<T>> search
-
numNeighbors
final int numNeighbors
-
p
final double p
-
p2
final double p2
-
-
Constructor Detail
-
InverseDistanceWeightingInterpolator
public InverseDistanceWeightingInterpolator(KNearestNeighborSearch<T> search, double p)
Creates a newInverseDistanceWeightingInterpolatorbased on aKNearestNeighborSearch.- Parameters:
search- - theKNearestNeighborSearchp- power applied to the distance, higher values result in 'sharper' results, 0 results in a non-weighted mean of the k nearest neighbors.
-
-
Method Detail
-
get
public T get()
Description copied from interface:SamplerAccess the actual T instance providing access to a pixel, sub-pixel or integral region value theSamplerpoints at.
-
getType
public T getType()
Description copied from interface:TypedGet an instance ofT.It should not be assumed that the returned
Tinstance is an independent copy. In particular, repeated calls togetType()may return the same instance.
-
computeWeight
protected double computeWeight(double squareDistance)
-
copy
public InverseDistanceWeightingInterpolator<T> copy()
- Specified by:
copyin interfaceRealRandomAccess<T extends RealType<T>>- Specified by:
copyin interfaceSampler<T extends RealType<T>>- Returns:
- - A new
Samplerin the same state accessing the same values. It does NOT copy T, just the state of theSampler. Otherwise use T.copy() if available. Sampler.copy().get() == Sampler.get(), i.e. both hold the same value, not necessarily the same instance (this is the case for anArrayCursorfor example)
-
-