Interface IterableRealInterval<T>
-
- Type Parameters:
T-
- All Superinterfaces:
EuclideanSpace,java.lang.Iterable<T>,RealInterval,Typed<T>
- All Known Subinterfaces:
Img<T>,IterableInterval<T>,NativeImg<T,A>,RandomAccessibleInterval<T>,SubIntervalIterable<T>
- All Known Implementing Classes:
AbstractCellImg,AbstractConvertedIterableInterval,AbstractConvertedIterableRandomAccessibleInterval,AbstractConvertedIterableRealInterval,AbstractConvertedRandomAccessibleInterval,AbstractImg,AbstractListImg,AbstractLongListImg,AbstractNativeImg,ARGBScreenImage,ArrayImg,ArrayImgAWTScreenImage,BiConvertedIterableInterval,BiConvertedIterableRealInterval,BiConvertedRandomAccessibleInterval,ByteAWTScreenImage,CellGrid.CellIntervals,CellImg,CompositeIntervalView,ConvertedIterableInterval,ConvertedIterableRealInterval,ConvertedRandomAccessibleInterval,DiscreteFrequencyDistribution,DoubleAWTScreenImage,FloatAWTScreenImage,Grid.CellIntervals,Histogram1d,HistogramNd,ImgView,IntAWTScreenImage,IntervalView,IterableRandomAccessibleInterval,IterableTransformBuilder.IterableIntervalView,IterableTransformBuilder.Slice,IterableTransformBuilder.SubInterval,KDTree,LazyCellImg,LazyCellImg.LazyCells,ListImg,NtreeImg,PlanarImg,PointSampleList,RealPointSampleList,ShortAWTScreenImage,StackView,SubsampleIntervalView,UnsignedByteAWTScreenImage,UnsignedIntAWTScreenImage,UnsignedShortAWTScreenImage,WriteConvertedIterableInterval,WriteConvertedIterableRandomAccessibleInterval,WriteConvertedIterableRealInterval,WriteConvertedRandomAccessibleInterval
public interface IterableRealInterval<T> extends RealInterval, java.lang.Iterable<T>, Typed<T>
f:Rn∈[0,s]→T
A function over real space and a finite set of elements in the target domain T. All target elements T can be accessed through Iterators. There is an iterator that tracks its source location at each move and one that calculates it on request only. Depending on the frequency of requesting the source location, either of them is optimal in terms of speed. Iteration order is constant for an individual
IterableRealIntervalbut not further specified.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description RealCursor<T>cursor()Returns aRealCursorthat iterates with optimal speed without calculating the location at each iteration step.default TfirstElement()Get the first element of thisIterableRealInterval.default TgetType()Get an instance ofT.java.lang.ObjectiterationOrder()Returns the iteration order of thisIterableRealInterval.default java.util.Iterator<T>iterator()RealCursor<T>localizingCursor()Returns aRealLocalizableIteratorthat calculates its location at each iteration step.default RealLocalizableSpliterator<T>localizingSpliterator()Creates aRealLocalizableSpliteratorover the elements of thisIterableRealInterval.default java.util.stream.Stream<T>parallelStream()Returns a parallelStreamover the elements of thisIterableRealInterval.longsize()Returns the number of elements in thisFunction.default RealLocalizableSpliterator<T>spliterator()Creates aRealLocalizableSpliteratorover the elements of thisIterableRealInterval.default java.util.stream.Stream<T>stream()Returns a sequentialStreamover the elements of thisIterableRealInterval.-
Methods inherited from interface net.imglib2.EuclideanSpace
numDimensions
-
Methods inherited from interface net.imglib2.RealInterval
maxAsDoubleArray, maxAsRealPoint, minAsDoubleArray, minAsRealPoint, realMax, realMax, realMax, realMin, realMin, realMin
-
-
-
-
Method Detail
-
cursor
RealCursor<T> cursor()
Returns a
RealCursorthat iterates with optimal speed without calculating the location at each iteration step. Localization is performed on demand.Use this where localization is required rarely/ not for each iteration.
- Returns:
- fast iterating iterator
-
localizingCursor
RealCursor<T> localizingCursor()
Returns a
RealLocalizableIteratorthat calculates its location at each iteration step. That is, localization is performed with optimal speed.Use this where localization is required often/ for each iteration.
- Returns:
- fast localizing iterator
-
size
long size()
Returns the number of elements in this
Function.- Returns:
- number of elements
-
firstElement
default T firstElement()
Get the first element of thisIterableRealInterval. This is a shortcut forcursor().next().This can be used to create a new variable of type T using
firstElement().createVariable(), which is useful in generic methods to store temporary results, e.g., a running sum over pixels in theIterableRealInterval.- Returns:
- the first element in iteration order.
-
getType
default T getType()
Get an instance ofT.It should not be assumed that the returned
Tinstance is an independent copy. In particular, repeated calls togetType()may return the same instance.The default implementation returns
firstElement(). Derived classes may choose different implementations for improved performance.
-
iterationOrder
java.lang.Object iterationOrder()
Returns the iteration order of thisIterableRealInterval. If the returned object equals (Object.equals(Object)) the iteration order of anotherIterableRealIntervalf then they can be copied by synchronous iteration. That is, having anIteratoron this and anotherIteratoron f, moving both in synchrony will point both of them to corresponding locations in their source domain. In other words, this and f have the same iteration order and means and the same number of elements.- Returns:
- the iteration order of this
IterableRealInterval. - See Also:
FlatIterationOrder
-
iterator
default java.util.Iterator<T> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<T>
-
stream
default java.util.stream.Stream<T> stream()
Returns a sequentialStreamover the elements of thisIterableRealInterval.Note that the returned
Streamgives access only to the values of the elements, not their locations. To obtain aStreamthat includes locations, seeStreams.localizable(net.imglib2.IterableRealInterval<T>).The default implementation creates a sequential
Streamfrom the interval'sspliterator().
-
parallelStream
default java.util.stream.Stream<T> parallelStream()
Returns a parallelStreamover the elements of thisIterableRealInterval.Note that the returned
Streamgives access only to the values of the elements, not their locations. To obtain aStreamthat includes locations, seeStreams.localizable(net.imglib2.IterableRealInterval<T>).The default implementation creates a parallel
Streamfrom the interval'sspliterator().
-
spliterator
default RealLocalizableSpliterator<T> spliterator()
Creates aRealLocalizableSpliteratorover the elements of thisIterableRealInterval. The returnedSpliteratoriterates with optimal speed without calculating the location at each iteration step. Localization is performed on demand.The default implementation wraps a
RealCursoron the interval. The createdSpliteratorreportsSpliterator.SIZED,Spliterator.SUBSIZED,Spliterator.ORDEREDandSpliterator.NONNULL.- Specified by:
spliteratorin interfacejava.lang.Iterable<T>
-
localizingSpliterator
default RealLocalizableSpliterator<T> localizingSpliterator()
Creates aRealLocalizableSpliteratorover the elements of thisIterableRealInterval. The returnedSpliteratorcalculates its location at each iteration step. That is, localization is performed with optimal speed.The default implementation wraps a
localizingRealCursoron the interval. The createdSpliteratorreportsSpliterator.SIZED,Spliterator.SUBSIZED,Spliterator.ORDEREDandSpliterator.NONNULL.
-
-