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>
RealRandomAccess to a KNearestNeighborSearch whose 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
FieldsModifier and TypeFieldDescriptionprotected static final double(package private) final int(package private) final double(package private) final doubleprotected final KNearestNeighborSearch<T> (package private) final TFields inherited from class AbstractRealLocalizable
positionFields inherited from class AbstractEuclideanSpace
n -
Constructor Summary
ConstructorsConstructorDescriptionInverseDistanceWeightingInterpolator(KNearestNeighborSearch<T> search, double p) Creates a newInverseDistanceWeightingInterpolatorbased on aKNearestNeighborSearch. -
Method Summary
Modifier and TypeMethodDescriptionprotected doublecomputeWeight(double squareDistance) copy()get()Access the actual T instance providing access to a pixel, sub-pixel or integral region value theSamplerpoints at.getType()Get an instance ofT.Methods inherited from class 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, wrapMethods inherited from class AbstractRealLocalizable
getDoublePosition, getFloatPosition, localize, localizeMethods inherited from class AbstractEuclideanSpace
numDimensionsMethods inherited from interface EuclideanSpace
numDimensionsMethods inherited from interface Positionable
bck, fwd, move, move, move, move, move, setPosition, setPosition, setPosition, setPosition, setPositionMethods inherited from interface RealLocalizable
getDoublePosition, getFloatPosition, localize, localize, localize, positionAsDoubleArray, positionAsRealPointMethods inherited from interface RealPositionable
move, move, move, move, move, setPosition, setPosition, setPosition, setPosition, setPositionMethods inherited from interface RealRandomAccess
copyRealRandomAccess, setPositionAndGet, setPositionAndGet, setPositionAndGet
-
Field Details
-
minThreshold
protected static final double minThreshold- See Also:
-
search
-
value
-
numNeighbors
final int numNeighbors -
p
final double p -
p2
final double p2
-
-
Constructor Details
-
InverseDistanceWeightingInterpolator
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 Details
-
get
-
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
- 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)
-