Class ZeroMinIntervalIterator

All Implemented Interfaces:
Dimensions, EuclideanSpace, Interval, Iterator, Localizable, RealInterval, RealLocalizable

public class ZeroMinIntervalIterator extends IntervalIterator
Use this class to iterate a virtual rectangular 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.