Class LanczosInterpolator<T extends RealType<T>>
java.lang.Object
net.imglib2.AbstractEuclideanSpace
net.imglib2.position.transform.AbstractPositionableTransform<RandomAccess<T>>
net.imglib2.position.transform.FloorOffset<RandomAccess<T>>
net.imglib2.interpolation.randomaccess.LanczosInterpolator<T>
- All Implemented Interfaces:
EuclideanSpace, Positionable, RealLocalizable, RealPositionable, RealRandomAccess<T>, Sampler<T>, Typed<T>
public class LanczosInterpolator<T extends RealType<T>>
extends FloorOffset<RandomAccess<T>>
implements RealRandomAccess<T>
n-dimensional double-based Lanczos Interpolation
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final intprotected final booleanprotected final Tprotected final double[]protected static final intprotected final long[]protected final doubleprotected final doubleprotected static final doubleprotected final double[]protected final long[]Fields inherited from class FloorOffset
offsetFields inherited from class AbstractPositionableTransform
discrete, position, targetFields inherited from class AbstractEuclideanSpace
n -
Constructor Summary
ConstructorsConstructorDescriptionLanczosInterpolator(LanczosInterpolator<T> interpolator) LanczosInterpolator(RandomAccessible<T> randomAccessible, int alpha, boolean clip, double min, double max) Creates a new Lanczos-interpolation -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidaccumulate(int d) copy()private static final double[]createLanczosLUT(int max, int scale) private static final long[]createOffset(int a, int n) get()Access the actual T instance providing access to a pixel, sub-pixel or integral region value theSamplerpoints at.getType()Get an instance ofT.private static final doublelanczos(double x, double a) private final doublelookUpLanczos(double x) protected final voidMethods inherited from class FloorOffset
f, f, f, f, f, move, move, move, move, move, setPosition, setPosition, setPosition, setPosition, setPositionMethods inherited from class AbstractPositionableTransform
bck, fwd, getDoublePosition, getFloatPosition, localize, localize, move, move, move, move, move, setPosition, setPosition, setPosition, setPosition, setPosition, toStringMethods inherited from class AbstractEuclideanSpace
numDimensionsMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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
-
piSquare
protected static final double piSquare- See Also:
-
lutScale
protected static final int lutScale- See Also:
-
alpha
protected final int alpha -
interpolatedValue
-
size
protected final long[] size -
max
protected final long[] max -
minValue
protected final double minValue -
maxValue
protected final double maxValue -
clip
protected final boolean clip -
lut
protected final double[] lut -
products
protected final double[] products
-
-
Constructor Details
-
LanczosInterpolator
public LanczosInterpolator(RandomAccessible<T> randomAccessible, int alpha, boolean clip, double min, double max) Creates a new Lanczos-interpolation- Parameters:
randomAccessible- - theRandomAccessibleto work onalpha- - the radius of values to incorporate (typically 2 or 3)clip- - clips the value to range of theRealType, i.e. tests if the interpolated value is out of rangemin- - range for clipping (ignored if min==max)max- - range for clipping (ignored if min==max)
-
LanczosInterpolator
-
-
Method Details
-
createOffset
private static final long[] createOffset(int a, int n) -
createLanczosLUT
private static final double[] createLanczosLUT(int max, int scale) -
resetKernel
protected final void resetKernel() -
accumulate
protected final void accumulate(int d) -
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. -
lanczos
private static final double lanczos(double x, double a) -
lookUpLanczos
private final double lookUpLanczos(double x) -
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)
-