public class LocalizingIntervalIterator extends IntervalIterator
Interval 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
LocalizingIntervalIterator to a Positionable.
...
LocalizingIntervalIterator i = new LocalizingIntervalIterator(image);
RandomAccess<T> s = image.randomAccess();
while (i.hasNext()) {
i.fwd();
s.setPosition(i);
s.type().performOperation(...);
...
}
...
Note that LocalizingIntervalIterator is the right choice in
situations where, for each pixel, you want to localize and/or set
the RandomAccess, that is, in a dense sampling situation. For
localizing sparsely (e.g. under an external condition), use
IntervalIterator instead.| Modifier and Type | Field and Description |
|---|---|
protected long[] |
position |
dimensions, index, lastIndex, stepsmax, minn| Constructor and Description |
|---|
LocalizingIntervalIterator(int[] dimensions) |
LocalizingIntervalIterator(int[] min,
int[] max) |
LocalizingIntervalIterator(Interval interval) |
LocalizingIntervalIterator(long[] dimensions) |
LocalizingIntervalIterator(long[] min,
long[] max) |
| Modifier and Type | Method and Description |
|---|---|
void |
fwd()
Move forward.
|
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 |
jumpFwd(long i)
Move steps × forward.
|
void |
localize(double[] pos)
Write the current position into the passed array.
|
void |
localize(float[] pos)
Write the current position into the passed array.
|
void |
localize(int[] pos)
Write the current position into the passed array.
|
void |
localize(long[] pos)
Write the current position into the passed array.
|
void |
reset()
Reset the
Iterator, that is put it to where it would be if newly
created. |
create, dimension, dimensions, getIndex, hasNext, 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 LocalizingIntervalIterator(long[] dimensions)
public LocalizingIntervalIterator(int[] dimensions)
public LocalizingIntervalIterator(long[] min,
long[] max)
public LocalizingIntervalIterator(int[] min,
int[] max)
public LocalizingIntervalIterator(Interval interval)
public void fwd()
Iteratorfwd in interface Iteratorfwd in class IntervalIteratorpublic void jumpFwd(long i)
IteratorjumpFwd in interface IteratorjumpFwd in class IntervalIteratori - number of steps to move forwardpublic void reset()
IteratorIterator, that is put it to where it would be if newly
created.reset in interface Iteratorreset in class IntervalIteratorpublic void localize(float[] pos)
RealLocalizablelocalize in interface RealLocalizablelocalize in class IntervalIteratorpos - receives current positionpublic void localize(double[] pos)
RealLocalizablelocalize in interface RealLocalizablelocalize in class IntervalIteratorpos - receives current positionpublic void localize(int[] pos)
Localizablelocalize in interface Localizablelocalize in class IntervalIteratorpos - receives current positionpublic void localize(long[] pos)
Localizablelocalize in interface Localizablelocalize in class IntervalIteratorpos - receives current positionpublic float getFloatPosition(int d)
RealLocalizablegetFloatPosition in interface LocalizablegetFloatPosition in interface RealLocalizablegetFloatPosition in class IntervalIteratord - dimensionpublic double getDoublePosition(int d)
RealLocalizablegetDoublePosition in interface LocalizablegetDoublePosition in interface RealLocalizablegetDoublePosition in class IntervalIteratord - dimensionpublic int getIntPosition(int d)
LocalizablegetIntPosition in interface LocalizablegetIntPosition in class IntervalIteratord - dimensionpublic long getLongPosition(int d)
LocalizablegetLongPosition in interface LocalizablegetLongPosition in class IntervalIteratord - dimensionCopyright © 2015–2022 ImgLib2. All rights reserved.