public class ZeroMinIntervalIterator extends IntervalIterator
Interval whose
min coordinates are at 0n in flat order, that
is: row by row, plane by plane, cube by cube, ... This is useful for
iterating an arbitrary interval in a defined order. For that, connect a
ZeroMinIntervalIterator to a Positionable.
...
ZeroMinIntervalIterator i = new ZeroMinIntervalIterator(image);
RandomAccess<T> s = image.randomAccess();
while (i.hasNext()) {
i.fwd();
s.setPosition(i);
s.type().performOperation(...);
...
}
...
Note that ZeroMinIntervalIterator is the right choice in situations
where not for each pixel you want to localize and/or set the
Positionable [Sampler], that is in a sparse sampling
situation. For localizing at each iteration step (as in the simplified
example above), use LocalizingZeroMinIntervalIterator instead.dimensions, index, lastIndex, stepsmax, minn| Constructor and Description |
|---|
ZeroMinIntervalIterator(Interval interval) |
ZeroMinIntervalIterator(long[] dimensions) |
| Modifier and Type | Method and Description |
|---|---|
double |
getDoublePosition(int d)
Return the current position in a given dimension.
|
float |
getFloatPosition(int d)
Return the current position in a given dimension.
|
int |
getIntPosition(int d)
Return the current position in a given dimension.
|
long |
getLongPosition(int d)
Return the current position in a given dimension.
|
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 |
localize(int[] position)
Write the current position into the passed array.
|
void |
localize(long[] position)
Write the current position into the passed array.
|
create, dimension, dimensions, fwd, getIndex, hasNext, jumpFwd, reset, toStringmax, max, max, min, min, min, realMax, realMax, realMax, realMin, realMin, realMinnumDimensionsclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitlocalize, positionAsLongArray, positionAsPointlocalize, positionAsDoubleArray, positionAsRealPointnumDimensionsmaxAsLongArray, maxAsPoint, minAsLongArray, minAsPointmaxAsDoubleArray, maxAsRealPoint, minAsDoubleArray, minAsRealPointallPositive, allPositive, dimensions, dimensionsAsLongArray, dimensionsAsPoint, verify, verify, verifyAllPositive, verifyAllPositivepublic ZeroMinIntervalIterator(long[] dimensions)
public ZeroMinIntervalIterator(Interval interval)
public final long getLongPosition(int d)
LocalizablegetLongPosition in interface LocalizablegetLongPosition in class IntervalIteratord - dimensionpublic final void localize(long[] position)
Localizablelocalize in interface Localizablelocalize in class IntervalIteratorposition - receives current positionpublic final int getIntPosition(int d)
LocalizablegetIntPosition in interface LocalizablegetIntPosition in class IntervalIteratord - dimensionpublic final void localize(int[] position)
Localizablelocalize in interface Localizablelocalize in class IntervalIteratorposition - receives current positionpublic final double getDoublePosition(int d)
RealLocalizablegetDoublePosition in interface LocalizablegetDoublePosition in interface RealLocalizablegetDoublePosition in class IntervalIteratord - dimensionpublic final void localize(double[] position)
RealLocalizablelocalize in interface RealLocalizablelocalize in class IntervalIteratorposition - receives current positionpublic final float getFloatPosition(int d)
RealLocalizablegetFloatPosition in interface LocalizablegetFloatPosition in interface RealLocalizablegetFloatPosition in class IntervalIteratord - dimensionpublic final void localize(float[] position)
RealLocalizablelocalize in interface RealLocalizablelocalize in class IntervalIteratorposition - receives current positionCopyright © 2015–2022 ImgLib2. All rights reserved.