T - the pixel typepublic class NearestNeighborRealRandomAccessibleStackInterpolator<T> extends AbstractEuclideanSpace implements RealRandomAccess<T>
RealRandomAccessibles.
When changing any dimension of the position, except the (n+1)th,
this position change is applied to the active slice
RealRandomAccess. When changing the (n+1)th dimension of
the position, a new slice RealRandomAccess becomes active, is set to
the position of the previously active slice RealRandomAccess.
Initially, only a RealRandomAccess for the first slice is created,
other slice RealRandomAccesses are created on demand but stored for
later re-use.
| Modifier and Type | Field and Description |
|---|---|
protected int |
lastSliceIndex |
protected double[] |
position |
protected int |
sd |
protected RealRandomAccess<T> |
sliceAccess |
protected RealRandomAccess<T>[] |
sliceAccesses |
protected int |
sliceIndex |
protected RealRandomAccessible<T>[] |
slices |
n| Modifier | Constructor and Description |
|---|---|
|
NearestNeighborRealRandomAccessibleStackInterpolator(List<RealRandomAccessible<T>> slices) |
protected |
NearestNeighborRealRandomAccessibleStackInterpolator(NearestNeighborRealRandomAccessibleStackInterpolator<T> a) |
|
NearestNeighborRealRandomAccessibleStackInterpolator(RealRandomAccessible<T>[] slices) |
| Modifier and Type | Method and Description |
|---|---|
void |
bck(int d)
Move by -1 in one dimension.
|
NearestNeighborRealRandomAccessibleStackInterpolator<T> |
copy() |
NearestNeighborRealRandomAccessibleStackInterpolator<T> |
copyRealRandomAccess() |
void |
fwd(int d)
Move by 1 in one dimension.
|
T |
get()
Access the actual T instance providing access to a pixel,
sub-pixel or integral region value the
Sampler points at. |
double |
getDoublePosition(int d)
Return the current position in a given dimension.
|
float |
getFloatPosition(int d)
Return the current position in a given dimension.
|
protected RealRandomAccess<T> |
getOrCreateAccess(int i) |
protected int |
getSliceIndex(double position) |
void |
localize(double[] position)
Write the current position into the passed array.
|
void |
localize(float[] position)
Write the current position into the passed array.
|
void |
move(double[] distance)
Move the element relative to its current location using a float[] as
distance vector.
|
void |
move(double distance,
int d)
Move the element in one dimension for some distance.
|
void |
move(float[] distance)
Move the element relative to its current location using a float[] as
distance vector.
|
void |
move(float distance,
int d)
Move the element in one dimension for some distance.
|
void |
move(int[] distance)
Move the element relative to its current location using an int[] as
distance vector.
|
void |
move(int distance,
int d)
Move the element in one dimension for some distance.
|
void |
move(Localizable distance)
Move the element relative to its current location using an
Localizable as distance vector. |
void |
move(long[] distance)
Move the element relative to its current location using a long[] as
distance vector.
|
void |
move(long distance,
int d)
Move the element in one dimension for some distance.
|
void |
move(RealLocalizable distance)
Move the element relative to its current location using a
RealLocalizable as distance vector. |
void |
setPosition(double[] position)
Set the position of the element.
|
void |
setPosition(double pos,
int d)
Set the position of the element for one dimension.
|
void |
setPosition(float[] position)
Set the position of the element.
|
void |
setPosition(float pos,
int d)
Set the position of the element for one dimension.
|
void |
setPosition(int[] position)
Set the position of the element.
|
void |
setPosition(int pos,
int d)
Set the position of the element for one dimension.
|
void |
setPosition(Localizable position)
Place the element at the same location as a given
Localizable |
void |
setPosition(long[] position)
Set the position of the element.
|
void |
setPosition(long pos,
int d)
Set the position of the element for one dimension.
|
void |
setPosition(RealLocalizable position)
Place the element at the same location as a given
RealLocalizable |
protected void |
setSlice(int i) |
protected void |
updateSlice(int i) |
numDimensionsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsetPositionAndGet, setPositionAndGet, setPositionAndGetlocalize, positionAsDoubleArray, positionAsRealPointnumDimensionsprotected final double[] position
protected final int sd
protected RealRandomAccess<T> sliceAccess
protected final RealRandomAccessible<T>[] slices
protected final RealRandomAccess<T>[] sliceAccesses
protected int sliceIndex
protected final int lastSliceIndex
public NearestNeighborRealRandomAccessibleStackInterpolator(RealRandomAccessible<T>[] slices)
public NearestNeighborRealRandomAccessibleStackInterpolator(List<RealRandomAccessible<T>> slices)
protected NearestNeighborRealRandomAccessibleStackInterpolator(NearestNeighborRealRandomAccessibleStackInterpolator<T> a)
protected int getSliceIndex(double position)
protected RealRandomAccess<T> getOrCreateAccess(int i)
protected void setSlice(int i)
protected void updateSlice(int i)
public void localize(float[] position)
RealLocalizablelocalize in interface RealLocalizableposition - receives current positionpublic void localize(double[] position)
RealLocalizablelocalize in interface RealLocalizableposition - receives current positionpublic float getFloatPosition(int d)
RealLocalizablegetFloatPosition in interface RealLocalizabled - dimensionpublic double getDoublePosition(int d)
RealLocalizablegetDoublePosition in interface RealLocalizabled - dimensionpublic void fwd(int d)
Positionablefwd in interface Positionabled - dimensionpublic void bck(int d)
Positionablebck in interface Positionabled - dimensionpublic void move(int distance,
int d)
Positionablemove in interface Positionabledistance - relative offset in dimension dd - dimensionpublic void move(long distance,
int d)
Positionablemove in interface Positionabledistance - relative offset in dimension dd - dimensionpublic void move(float distance,
int d)
RealPositionablemove in interface RealPositionablepublic void move(double distance,
int d)
RealPositionablemove in interface RealPositionablepublic void move(RealLocalizable distance)
RealPositionableRealLocalizable as distance vector.move in interface RealPositionabledistance - relative offset, EuclideanSpace.numDimensions() must
be ≥ EuclideanSpace.numDimensions()public void move(Localizable distance)
PositionableLocalizable as distance vector.move in interface Positionabledistance - relative offset, EuclideanSpace.numDimensions() must be
≥ EuclideanSpace.numDimensions()public void move(int[] distance)
Positionablemove in interface Positionabledistance - relative offset, length must be ≥ EuclideanSpace.numDimensions()public void move(long[] distance)
Positionablemove in interface Positionabledistance - relative offset, length must be ≥ EuclideanSpace.numDimensions()public void move(double[] distance)
RealPositionablemove in interface RealPositionablepublic void move(float[] distance)
RealPositionablemove in interface RealPositionablepublic void setPosition(Localizable position)
PositionableLocalizablesetPosition in interface Positionableposition - absolute position, EuclideanSpace.numDimensions() must be
≥ EuclideanSpace.numDimensions()public void setPosition(RealLocalizable position)
RealPositionableRealLocalizablesetPosition in interface RealPositionableposition - absolute position, EuclideanSpace.numDimensions()
must be ≥ EuclideanSpace.numDimensions()public void setPosition(int[] position)
PositionablesetPosition in interface Positionableposition - absolute position, length must be ≥
EuclideanSpace.numDimensions()public void setPosition(long[] position)
PositionablesetPosition in interface Positionableposition - absolute position, length must be ≥
EuclideanSpace.numDimensions()public void setPosition(double[] position)
RealPositionablesetPosition in interface RealPositionableposition - absolute position, length must be ≥
EuclideanSpace.numDimensions()public void setPosition(float[] position)
RealPositionablesetPosition in interface RealPositionableposition - absolute position, length must be ≥
EuclideanSpace.numDimensions()public void setPosition(int pos,
int d)
PositionablesetPosition in interface Positionablepos - absolute position in dimension dd - dimensionpublic void setPosition(long pos,
int d)
PositionablesetPosition in interface Positionablepos - absolute position in dimension dd - dimensionpublic void setPosition(float pos,
int d)
RealPositionablesetPosition in interface RealPositionablepublic void setPosition(double pos,
int d)
RealPositionablesetPosition in interface RealPositionablepublic T get()
SamplerSampler points at.public NearestNeighborRealRandomAccessibleStackInterpolator<T> copy()
copy in interface Sampler<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)public NearestNeighborRealRandomAccessibleStackInterpolator<T> copyRealRandomAccess()
copyRealRandomAccess in interface RealRandomAccess<T>Copyright © 2015–2022 ImgLib2. All rights reserved.