Package net.imglib2.iterator
Class ZeroMinIntervalIterator
- java.lang.Object
-
- net.imglib2.AbstractEuclideanSpace
-
- net.imglib2.AbstractInterval
-
- net.imglib2.iterator.IntervalIterator
-
- net.imglib2.iterator.ZeroMinIntervalIterator
-
- All Implemented Interfaces:
Dimensions
,EuclideanSpace
,Interval
,Iterator
,Localizable
,RealInterval
,RealLocalizable
public class ZeroMinIntervalIterator extends IntervalIterator
Use this class to iterate a virtual rectangularInterval
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 aZeroMinIntervalIterator
to aPositionable
.... ZeroMinIntervalIterator i = new ZeroMinIntervalIterator(image); RandomAccess<T> s = image.randomAccess(); while (i.hasNext()) { i.fwd(); s.setPosition(i); s.type().performOperation(...); ... } ...
ZeroMinIntervalIterator
is the right choice in situations where not for each pixel you want to localize and/or set thePositionable
[Sampler
], that is in a sparse sampling situation. For localizing at each iteration step (as in the simplified example above), useLocalizingZeroMinIntervalIterator
instead.- Author:
- Stephan Preibisch, Stephan Saalfeld
-
-
Field Summary
-
Fields inherited from class net.imglib2.iterator.IntervalIterator
dimensions, index, lastIndex, steps
-
Fields inherited from class net.imglib2.AbstractInterval
max, min
-
Fields inherited from class net.imglib2.AbstractEuclideanSpace
n
-
-
Constructor Summary
Constructors Constructor Description ZeroMinIntervalIterator(long[] dimensions)
ZeroMinIntervalIterator(Interval interval)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.-
Methods inherited from class net.imglib2.iterator.IntervalIterator
create, dimension, dimensions, fwd, getIndex, hasNext, jumpFwd, reset, toString
-
Methods inherited from class net.imglib2.AbstractInterval
max, max, max, min, min, min, realMax, realMax, realMax, realMin, realMin, realMin
-
Methods inherited from class net.imglib2.AbstractEuclideanSpace
numDimensions
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.imglib2.EuclideanSpace
numDimensions
-
-
-
-
Constructor Detail
-
ZeroMinIntervalIterator
public ZeroMinIntervalIterator(long[] dimensions)
-
ZeroMinIntervalIterator
public ZeroMinIntervalIterator(Interval interval)
-
-
Method Detail
-
getLongPosition
public final long getLongPosition(int d)
Description copied from interface:Localizable
Return the current position in a given dimension.- Specified by:
getLongPosition
in interfaceLocalizable
- Overrides:
getLongPosition
in classIntervalIterator
- Parameters:
d
- dimension- Returns:
- dimension of current position
-
localize
public final void localize(long[] position)
Description copied from interface:Localizable
Write the current position into the passed array.- Specified by:
localize
in interfaceLocalizable
- Overrides:
localize
in classIntervalIterator
- Parameters:
position
- receives current position
-
getIntPosition
public final int getIntPosition(int d)
Description copied from interface:Localizable
Return the current position in a given dimension.- Specified by:
getIntPosition
in interfaceLocalizable
- Overrides:
getIntPosition
in classIntervalIterator
- Parameters:
d
- dimension- Returns:
- dimension of current position
-
localize
public final void localize(int[] position)
Description copied from interface:Localizable
Write the current position into the passed array.- Specified by:
localize
in interfaceLocalizable
- Overrides:
localize
in classIntervalIterator
- Parameters:
position
- receives current position
-
getDoublePosition
public final double getDoublePosition(int d)
Description copied from interface:RealLocalizable
Return the current position in a given dimension.- Specified by:
getDoublePosition
in interfaceRealLocalizable
- Overrides:
getDoublePosition
in classIntervalIterator
- Parameters:
d
- dimension- Returns:
- dimension of current position
-
localize
public final void localize(double[] position)
Description copied from interface:RealLocalizable
Write the current position into the passed array.- Specified by:
localize
in interfaceRealLocalizable
- Overrides:
localize
in classIntervalIterator
- Parameters:
position
- receives current position
-
getFloatPosition
public final float getFloatPosition(int d)
Description copied from interface:RealLocalizable
Return the current position in a given dimension.- Specified by:
getFloatPosition
in interfaceRealLocalizable
- Overrides:
getFloatPosition
in classIntervalIterator
- Parameters:
d
- dimension- Returns:
- dimension of current position
-
localize
public final void localize(float[] position)
Description copied from interface:RealLocalizable
Write the current position into the passed array.- Specified by:
localize
in interfaceRealLocalizable
- Overrides:
localize
in classIntervalIterator
- Parameters:
position
- receives current position
-
-