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, steps
max, min
n
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, 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 ZeroMinIntervalIterator(long[] dimensions)
public ZeroMinIntervalIterator(Interval interval)
public final long getLongPosition(int d)
Localizable
getLongPosition
in interface Localizable
getLongPosition
in class IntervalIterator
d
- dimensionpublic final void localize(long[] position)
Localizable
localize
in interface Localizable
localize
in class IntervalIterator
position
- receives current positionpublic final int getIntPosition(int d)
Localizable
getIntPosition
in interface Localizable
getIntPosition
in class IntervalIterator
d
- dimensionpublic final void localize(int[] position)
Localizable
localize
in interface Localizable
localize
in class IntervalIterator
position
- receives current positionpublic final double getDoublePosition(int d)
RealLocalizable
getDoublePosition
in interface Localizable
getDoublePosition
in interface RealLocalizable
getDoublePosition
in class IntervalIterator
d
- dimensionpublic final void localize(double[] position)
RealLocalizable
localize
in interface RealLocalizable
localize
in class IntervalIterator
position
- receives current positionpublic final float getFloatPosition(int d)
RealLocalizable
getFloatPosition
in interface Localizable
getFloatPosition
in interface RealLocalizable
getFloatPosition
in class IntervalIterator
d
- dimensionpublic final void localize(float[] position)
RealLocalizable
localize
in interface RealLocalizable
localize
in class IntervalIterator
position
- receives current positionCopyright © 2015–2022 ImgLib2. All rights reserved.