Package net.imglib2.iterator
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 virtualRealIntervalin 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
Fields Modifier and Type Field Description protected double[]locationprotected double[]step-
Fields inherited from class net.imglib2.AbstractRealInterval
max, min
-
Fields inherited from class net.imglib2.AbstractEuclideanSpace
n
-
-
Constructor Summary
Constructors Constructor Description LocalizingRealIntervalIterator(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfwd()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.java.lang.StringtoString()-
Methods inherited from class net.imglib2.AbstractRealInterval
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
-
Methods inherited from interface net.imglib2.RealInterval
maxAsDoubleArray, maxAsRealPoint, minAsDoubleArray, minAsRealPoint
-
Methods inherited from interface net.imglib2.RealLocalizable
localize, positionAsDoubleArray, positionAsRealPoint
-
-
-
-
Constructor Detail
-
LocalizingRealIntervalIterator
public LocalizingRealIntervalIterator(RealInterval interval, double[] step)
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 Detail
-
reset
public void reset()
Description copied from interface:IteratorReset theIterator, that is put it to where it would be if newly created.
-
hasNext
public boolean hasNext()
Description copied from interface:IteratorReturns true if another step forward is possible.
-
toString
public java.lang.String 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
public void jumpFwd(long steps)
Description copied from interface:IteratorMove steps × forward.Highly recommended to override this with a more efficient version.
-
fwd
public void fwd()
Description copied from interface:IteratorMove forward.
-
fwdDim
private void fwdDim(int d)
-
-