T
- public class NLinearInterpolator3D<T extends NumericType<T>> extends NLinearInterpolator<T>
accumulator, code, tmp, weights
discrete, position, target
n
Modifier | Constructor and Description |
---|---|
protected |
NLinearInterpolator3D(NLinearInterpolator3D<T> interpolator) |
protected |
NLinearInterpolator3D(RandomAccessible<T> randomAccessible) |
protected |
NLinearInterpolator3D(RandomAccessible<T> randomAccessible,
T type) |
Modifier and Type | Method and Description |
---|---|
NLinearInterpolator3D<T> |
copy() |
protected void |
fillWeights()
Fill the
weights array. |
T |
get()
Get the interpolated value at the current position.
|
int |
numDimensions()
Gets the space's number of dimensions.
|
copyRealRandomAccess
floor, floor, floor, floor, floor, move, move, move, move, move, setPosition, setPosition, setPosition, setPosition, setPosition
bck, fwd, getDoublePosition, getFloatPosition, localize, localize, move, move, move, move, move, setPosition, setPosition, setPosition, setPosition, setPosition, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
setPositionAndGet, setPositionAndGet, setPositionAndGet
getDoublePosition, getFloatPosition, localize, localize, localize, positionAsDoubleArray, positionAsRealPoint
move, move, move, move, move, setPosition, setPosition, setPosition, setPosition, setPosition
bck, fwd, move, move, move, move, move, setPosition, setPosition, setPosition, setPosition, setPosition
protected NLinearInterpolator3D(NLinearInterpolator3D<T> interpolator)
protected NLinearInterpolator3D(RandomAccessible<T> randomAccessible, T type)
protected NLinearInterpolator3D(RandomAccessible<T> randomAccessible)
public final int numDimensions()
EuclideanSpace
numDimensions
in interface EuclideanSpace
numDimensions
in class AbstractEuclideanSpace
protected void fillWeights()
NLinearInterpolator
weights
array.
Let w_d denote the fraction of a pixel at which the sample position p_d lies from the floored position pf_d in dimension d. That is, the value at pf_d contributes with (1 - w_d) to the sampled value; the value at ( pf_d + 1 ) contributes with w_d.
At every pixel, the total weight results from multiplying the weights of all dimensions for that pixel. That is, the "top-left" contributing pixel (position floored in all dimensions) gets assigned weight (1-w_0)(1-w_1)...(1-w_n).
We work through the weights array starting from the highest dimension. For the highest dimension, the first half of the weights contain the factor (1 - w_n) because this first half corresponds to floored pixel positions in the highest dimension. The second half contain the factor w_n. In this first step, the first weight of the first half gets assigned (1 - w_n). The first element of the second half gets assigned w_n
From their, we work recursively down to dimension 0. That is, each half of weights is again split recursively into two partitions. The first element of the second partitions is the first element of the half multiplied with (w_d). The first element of the first partitions is multiplied with (1 - w_d).
When we have reached dimension 0, all weights will have a value assigned.
fillWeights
in class NLinearInterpolator<T extends NumericType<T>>
public T get()
NLinearInterpolator
To visit the pixels that contribute to an interpolated value, we move in a (binary-reflected) Gray code pattern, such that only one dimension of the target position is modified per move.
get
in interface Sampler<T extends NumericType<T>>
get
in class NLinearInterpolator<T extends NumericType<T>>
public NLinearInterpolator3D<T> copy()
copy
in interface Sampler<T extends NumericType<T>>
copy
in class NLinearInterpolator<T extends NumericType<T>>
Sampler
in the same state accessing the same
values.
It does NOT copy T, just the state of the Sampler
.
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 an
ArrayCursor
for example)Copyright © 2015–2022 ImgLib2. All rights reserved.