Class LocalizingRealIntervalIterator
java.lang.Object
net.imglib2.AbstractEuclideanSpace
net.imglib2.AbstractRealInterval
net.imglib2.iterator.LocalizingRealIntervalIterator
- All Implemented Interfaces:
EuclideanSpace, Iterator, RealInterval, RealLocalizable
public class LocalizingRealIntervalIterator
extends AbstractRealInterval
implements Iterator, RealLocalizable
Use this class to iterate a virtual
RealInterval in flat order, that
is: with the first dimension varying most quickly and the last dimension
varying most slowly. This is useful for iterating an arbitrary real interval
in a defined order.-
Field Summary
FieldsFields inherited from class AbstractRealInterval
max, minFields inherited from class AbstractEuclideanSpace
n -
Constructor Summary
ConstructorsConstructorDescriptionLocalizingRealIntervalIterator(double[] min, double[] max, double[] step) Iterates anRealIntervalwith given min and max the the provided step along each dimension.LocalizingRealIntervalIterator(RealInterval interval, double[] step) Iterates anRealIntervalwith given min and max with the provided step along each dimension. -
Method Summary
Modifier and TypeMethodDescriptionvoidfwd()Move forward.private voidfwdDim(int d) doublegetDoublePosition(int d) Return the current position in a given dimension.floatgetFloatPosition(int d) Return the current position in a given dimension.booleanhasNext()Returns true if another step forward is possible.voidjumpFwd(long steps) Move steps × forward.voidlocalize(double[] position) Write the current position into the passed array.voidlocalize(float[] position) Write the current position into the passed array.voidreset()Reset theIterator, that is put it to where it would be if newly created.toString()Methods inherited from class AbstractRealInterval
realMax, realMax, realMax, realMin, realMin, realMinMethods inherited from class AbstractEuclideanSpace
numDimensionsMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface EuclideanSpace
numDimensionsMethods inherited from interface RealInterval
maxAsDoubleArray, maxAsRealPoint, minAsDoubleArray, minAsRealPointMethods inherited from interface RealLocalizable
localize, positionAsDoubleArray, positionAsRealPoint
-
Field Details
-
step
protected final double[] step -
location
protected final double[] location
-
-
Constructor Details
-
LocalizingRealIntervalIterator
Iterates anRealIntervalwith given min and max with the provided step along each dimension.- Parameters:
interval- the real intervalstep- iteration step
-
LocalizingRealIntervalIterator
public LocalizingRealIntervalIterator(double[] min, double[] max, double[] step) Iterates anRealIntervalwith given min and max the the provided step along each dimension.- Parameters:
min- real interval minmax- real interval minstep- iteration steps
-
-
Method Details
-
reset
-
hasNext
-
toString
- Overrides:
toStringin classAbstractRealInterval
-
localize
public void localize(float[] position) Description copied from interface:RealLocalizableWrite the current position into the passed array.- Specified by:
localizein interfaceRealLocalizable- Parameters:
position- receives current position, length must be ≥EuclideanSpace.numDimensions()
-
localize
public void localize(double[] position) Description copied from interface:RealLocalizableWrite the current position into the passed array.- Specified by:
localizein interfaceRealLocalizable- Parameters:
position- receives current position, length must be ≥EuclideanSpace.numDimensions()
-
getFloatPosition
public float getFloatPosition(int d) Description copied from interface:RealLocalizableReturn the current position in a given dimension.- Specified by:
getFloatPositionin interfaceRealLocalizable- Parameters:
d- dimension- Returns:
- dimension of current position
-
getDoublePosition
public double getDoublePosition(int d) Description copied from interface:RealLocalizableReturn the current position in a given dimension.- Specified by:
getDoublePositionin interfaceRealLocalizable- Parameters:
d- dimension- Returns:
- dimension of current position
-
jumpFwd
-
fwd
-
fwdDim
private void fwdDim(int d)
-