Package net.imglib2.img
Class ImgView<T extends Type<T>>
- java.lang.Object
-
- net.imglib2.AbstractWrappedRealInterval<I>
-
- net.imglib2.AbstractWrappedInterval<RandomAccessibleInterval<T>>
-
- net.imglib2.view.IterableRandomAccessibleInterval<T>
-
- net.imglib2.img.ImgView<T>
-
- All Implemented Interfaces:
java.lang.Iterable<T>
,Dimensions
,EuclideanSpace
,Img<T>
,Interval
,IterableInterval<T>
,IterableRealInterval<T>
,RandomAccessible<T>
,RandomAccessibleInterval<T>
,RealInterval
,View
,SubIntervalIterable<T>
public class ImgView<T extends Type<T>> extends IterableRandomAccessibleInterval<T> implements Img<T>, SubIntervalIterable<T>
Allows aRandomAccessibleInterval
to be treated as anImg
.- Author:
- Tobias Pietzsch, Christian Dietz
-
-
Field Summary
-
Fields inherited from class net.imglib2.AbstractWrappedRealInterval
sourceInterval
-
-
Constructor Summary
Constructors Constructor Description ImgView(RandomAccessibleInterval<T> in, ImgFactory<T> fac)
Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Img<T>
copy()
Cursor<T>
cursor()
Returns aRealCursor
that iterates with optimal speed without calculating the location at each iteration step.Cursor<T>
cursor(Interval interval)
ImgFactory<T>
factory()
Get aImgFactory
that createsImg
s of the same kind as this one.Cursor<T>
localizingCursor()
Returns aRealLocalizable
Iterator
that calculates its location at each iteration step.Cursor<T>
localizingCursor(Interval interval)
java.lang.Object
subIntervalIterationOrder(Interval interval)
Returns the iteration order given the interval.boolean
supportsOptimizedCursor(Interval interval)
static <T extends Type<T>>
Img<T>wrap(RandomAccessibleInterval<T> accessible, ImgFactory<T> factory)
Represent an arbitrary RandomAccessibleInterval as an Img-
Methods inherited from class net.imglib2.view.IterableRandomAccessibleInterval
create, firstElement, iterationOrder, iterator, randomAccess, randomAccess, size
-
Methods inherited from class net.imglib2.AbstractWrappedInterval
dimension, dimensions, max, max, max, min, min, min
-
Methods inherited from class net.imglib2.AbstractWrappedRealInterval
getSource, numDimensions, realMax, realMax, realMax, realMin, realMin, realMin
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.imglib2.Dimensions
dimension, dimensions
-
Methods inherited from interface net.imglib2.EuclideanSpace
numDimensions
-
Methods inherited from interface net.imglib2.IterableRealInterval
firstElement, iterationOrder, size
-
Methods inherited from interface net.imglib2.RandomAccessible
randomAccess, randomAccess
-
-
-
-
Constructor Detail
-
ImgView
@Deprecated public ImgView(RandomAccessibleInterval<T> in, ImgFactory<T> fac)
Deprecated.View onImg
which is defined by a given Interval, but still is anImg
. Deprecation: Usewrap(RandomAccessibleInterval, ImgFactory)
to represent a RandomAccessibleInterval as an Img- Parameters:
in
- Source interval for the viewfac
- T Factory to create img
-
-
Method Detail
-
factory
public ImgFactory<T> factory()
Description copied from interface:Img
Get aImgFactory
that createsImg
s of the same kind as this one. This is useful to create Imgs for temporary storage in generic methods where the specific Img type is unknown. Note, that the factory can be used even if all references to this Img have been invalidated.
-
cursor
public Cursor<T> cursor()
Description copied from interface:IterableRealInterval
Returns a
RealCursor
that 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.
- Specified by:
cursor
in interfaceIterableInterval<T extends Type<T>>
- Specified by:
cursor
in interfaceIterableRealInterval<T extends Type<T>>
- Overrides:
cursor
in classIterableRandomAccessibleInterval<T extends Type<T>>
- Returns:
- fast iterating iterator
-
localizingCursor
public Cursor<T> localizingCursor()
Description copied from interface:IterableRealInterval
Returns a
RealLocalizable
Iterator
that 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.
- Specified by:
localizingCursor
in interfaceIterableInterval<T extends Type<T>>
- Specified by:
localizingCursor
in interfaceIterableRealInterval<T extends Type<T>>
- Overrides:
localizingCursor
in classIterableRandomAccessibleInterval<T extends Type<T>>
- Returns:
- fast localizing iterator
-
supportsOptimizedCursor
public boolean supportsOptimizedCursor(Interval interval)
Description copied from interface:SubIntervalIterable
- Specified by:
supportsOptimizedCursor
in interfaceSubIntervalIterable<T extends Type<T>>
- Parameters:
interval
- to be checked- Returns:
- true if a
Cursor
can be optimized given theInterval
-
subIntervalIterationOrder
public java.lang.Object subIntervalIterationOrder(Interval interval)
Description copied from interface:SubIntervalIterable
Returns the iteration order given the interval.- Specified by:
subIntervalIterationOrder
in interfaceSubIntervalIterable<T extends Type<T>>
- Parameters:
interval
-Interval
over which to iterate- Returns:
- the iteration order object @see
IterableRealInterval
-
cursor
public Cursor<T> cursor(Interval interval)
Description copied from interface:SubIntervalIterable
-
localizingCursor
public Cursor<T> localizingCursor(Interval interval)
Description copied from interface:SubIntervalIterable
- Specified by:
localizingCursor
in interfaceSubIntervalIterable<T extends Type<T>>
- Parameters:
interval
-Interval
over which to iterate- Returns:
Cursor
-
wrap
public static <T extends Type<T>> Img<T> wrap(RandomAccessibleInterval<T> accessible, ImgFactory<T> factory)
Represent an arbitrary RandomAccessibleInterval as an Img- Parameters:
accessible
- RandomAccessibleInterval which will be wrapped with an ImgViewfactory
- ImgFactory returned byfactory()
- Returns:
- RandomAccessibleInterval represented as an Img
-
-