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,Typed<T>,View,SubIntervalIterable<T>
public class ImgView<T extends Type<T>> extends IterableRandomAccessibleInterval<T> implements Img<T>, SubIntervalIterable<T>
Allows aRandomAccessibleIntervalto be treated as anImg.
-
-
Field Summary
Fields Modifier and Type Field Description private ImgFactory<T>factoryprivate IterableInterval<T>ii-
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 aRealCursorthat iterates with optimal speed without calculating the location at each iteration step.Cursor<T>cursor(Interval interval)ImgFactory<T>factory()Get aImgFactorythat createsImgs of the same kind as this one.Cursor<T>localizingCursor()Returns aRealLocalizableIteratorthat calculates its location at each iteration step.Cursor<T>localizingCursor(Interval interval)java.lang.ObjectsubIntervalIterationOrder(Interval interval)Returns the iteration order given the interval.booleansupportsOptimizedCursor(Interval interval)static <T extends Type<T>>
Img<T>wrap(RandomAccessibleInterval<T> accessible)Represent an arbitraryRandomAccessibleIntervalas anImg, with a suitableImgFactoryfor its size and type, created byUtil.getSuitableImgFactory(net.imglib2.Dimensions, Object).static <T extends Type<T>>
Img<T>wrap(RandomAccessibleInterval<T> accessible, ImgFactory<T> factory)Represent an arbitraryRandomAccessibleIntervalas anImg.-
Methods inherited from class net.imglib2.view.IterableRandomAccessibleInterval
create, getType, iterationOrder, 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
dimensions, dimensions, dimensionsAsLongArray, dimensionsAsPoint
-
Methods inherited from interface net.imglib2.EuclideanSpace
numDimensions
-
Methods inherited from interface net.imglib2.Interval
dimension, max, max, max, maxAsLongArray, maxAsPoint, min, min, min, minAsLongArray, minAsPoint, realMax, realMin
-
Methods inherited from interface net.imglib2.IterableInterval
localizingSpliterator, spliterator
-
Methods inherited from interface net.imglib2.IterableRealInterval
firstElement, getType, iterator, parallelStream, stream
-
Methods inherited from interface net.imglib2.RandomAccessible
getAt, getAt, getAt, randomAccess, randomAccess
-
Methods inherited from interface net.imglib2.RandomAccessibleInterval
iterationOrder, size
-
Methods inherited from interface net.imglib2.RealInterval
maxAsDoubleArray, maxAsRealPoint, minAsDoubleArray, minAsRealPoint, realMax, realMax, realMin, realMin
-
-
-
-
Field Detail
-
factory
private final ImgFactory<T extends Type<T>> factory
-
ii
private final IterableInterval<T extends Type<T>> ii
-
-
Constructor Detail
-
ImgView
@Deprecated public ImgView(RandomAccessibleInterval<T> in, ImgFactory<T> fac)
Deprecated.View onImgwhich 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:ImgGet aImgFactorythat createsImgs 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:IterableRealIntervalReturns 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.
- Specified by:
cursorin interfaceIterableInterval<T extends Type<T>>- Specified by:
cursorin interfaceIterableRealInterval<T extends Type<T>>- Specified by:
cursorin interfaceRandomAccessibleInterval<T extends Type<T>>- Overrides:
cursorin classIterableRandomAccessibleInterval<T extends Type<T>>- Returns:
- fast iterating iterator
-
localizingCursor
public Cursor<T> localizingCursor()
Description copied from interface:IterableRealIntervalReturns 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.
- Specified by:
localizingCursorin interfaceIterableInterval<T extends Type<T>>- Specified by:
localizingCursorin interfaceIterableRealInterval<T extends Type<T>>- Specified by:
localizingCursorin interfaceRandomAccessibleInterval<T extends Type<T>>- Overrides:
localizingCursorin classIterableRandomAccessibleInterval<T extends Type<T>>- Returns:
- fast localizing iterator
-
supportsOptimizedCursor
public boolean supportsOptimizedCursor(Interval interval)
Description copied from interface:SubIntervalIterable- Specified by:
supportsOptimizedCursorin interfaceSubIntervalIterable<T extends Type<T>>- Parameters:
interval- to be checked- Returns:
- true if a
Cursorcan be optimized given theInterval
-
subIntervalIterationOrder
public java.lang.Object subIntervalIterationOrder(Interval interval)
Description copied from interface:SubIntervalIterableReturns the iteration order given the interval.- Specified by:
subIntervalIterationOrderin interfaceSubIntervalIterable<T extends Type<T>>- Parameters:
interval-Intervalover 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:
localizingCursorin interfaceSubIntervalIterable<T extends Type<T>>- Parameters:
interval-Intervalover which to iterate- Returns:
Cursor
-
wrap
public static <T extends Type<T>> Img<T> wrap(RandomAccessibleInterval<T> accessible)
Represent an arbitraryRandomAccessibleIntervalas anImg, with a suitableImgFactoryfor its size and type, created byUtil.getSuitableImgFactory(net.imglib2.Dimensions, Object).- Parameters:
accessible- RandomAccessibleInterval which will be wrapped with an ImgView- Returns:
- RandomAccessibleInterval represented as an Img
- See Also:
Util.getSuitableImgFactory(net.imglib2.Dimensions, Object)
-
wrap
public static <T extends Type<T>> Img<T> wrap(RandomAccessibleInterval<T> accessible, ImgFactory<T> factory)
Represent an arbitraryRandomAccessibleIntervalas anImg.- Parameters:
accessible- RandomAccessibleInterval which will be wrapped with an ImgViewfactory- ImgFactory returned byfactory()- Returns:
- RandomAccessibleInterval represented as an Img
-
-