public class LocalizingZeroMinIntervalIterator extends LocalizingIntervalIterator
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
LocalizingZeroMinIntervalIterator
to a Positionable
.
...
LocalizingZeroMinIntervalIterator i = new LocalizingZeroMinIntervalIterator(image);
RandomAccess<T> s = image.randomAccess();
while (i.hasNext()) {
i.fwd();
s.setPosition(i);
s.type().performOperation(...);
...
}
...
Note that LocalizingZeroMinIntervalIterator
is the right choice in
situations where, for each pixel, you want to localize and/or set
the Positionable
[Sampler
], that is in a dense sampling
situation. For localizing sparsely (e.g. under an external condition), use
ZeroMinIntervalIterator
instead.position
dimensions, index, lastIndex, steps
max, min
n
Constructor and Description |
---|
LocalizingZeroMinIntervalIterator(int[] dimensions) |
LocalizingZeroMinIntervalIterator(Interval interval) |
LocalizingZeroMinIntervalIterator(long[] dimensions) |
Modifier and Type | Method and Description |
---|---|
void |
fwd()
Move forward.
|
void |
jumpFwd(long i)
Move steps × forward.
|
void |
reset()
Reset the
Iterator , that is put it to where it would be if newly
created. |
getDoublePosition, getFloatPosition, getIntPosition, getLongPosition, localize, localize, localize, localize
create, dimension, dimensions, getIndex, hasNext, toString
max, max, max, min, min, min, realMax, realMax, realMax, realMin, realMin, realMin
numDimensions
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
localize, positionAsLongArray, positionAsPoint
localize, positionAsDoubleArray, positionAsRealPoint
numDimensions
maxAsLongArray, maxAsPoint, minAsLongArray, minAsPoint
maxAsDoubleArray, maxAsRealPoint, minAsDoubleArray, minAsRealPoint
allPositive, allPositive, dimensions, dimensionsAsLongArray, dimensionsAsPoint, verify, verify, verifyAllPositive, verifyAllPositive
public LocalizingZeroMinIntervalIterator(long[] dimensions)
public LocalizingZeroMinIntervalIterator(int[] dimensions)
public LocalizingZeroMinIntervalIterator(Interval interval)
public void fwd()
Iterator
fwd
in interface Iterator
fwd
in class LocalizingIntervalIterator
public void jumpFwd(long i)
Iterator
jumpFwd
in interface Iterator
jumpFwd
in class LocalizingIntervalIterator
i
- number of steps to move forwardCopyright © 2015–2022 ImgLib2. All rights reserved.