Module org.bigdataviewer.core
Package bdv.img.cache
Class VolatileCachedCellImg<T extends net.imglib2.type.NativeType<T>,A extends net.imglib2.img.basictypeaccess.DataAccess>
- java.lang.Object
-
- net.imglib2.img.AbstractImg<T>
-
- net.imglib2.img.AbstractNativeImg<T,A>
-
- net.imglib2.img.cell.AbstractCellImg<T,A,net.imglib2.img.cell.Cell<A>,VolatileCachedCellImg.VolatileCachedCells<net.imglib2.img.cell.Cell<A>>>
-
- bdv.img.cache.VolatileCachedCellImg<T,A>
-
- Type Parameters:
T- the pixel typeA- the underlying native access type
- All Implemented Interfaces:
Iterable<T>,net.imglib2.Dimensions,net.imglib2.EuclideanSpace,net.imglib2.img.Img<T>,net.imglib2.img.NativeImg<T,A>,net.imglib2.Interval,net.imglib2.IterableInterval<T>,net.imglib2.IterableRealInterval<T>,net.imglib2.RandomAccessible<T>,net.imglib2.RandomAccessibleInterval<T>,net.imglib2.RealInterval,net.imglib2.Typed<T>
public class VolatileCachedCellImg<T extends net.imglib2.type.NativeType<T>,A extends net.imglib2.img.basictypeaccess.DataAccess> extends net.imglib2.img.cell.AbstractCellImg<T,A,net.imglib2.img.cell.Cell<A>,VolatileCachedCellImg.VolatileCachedCells<net.imglib2.img.cell.Cell<A>>>
ALazyCellImgforVolatileaccesses. The only difference toLazyCellImgis that is hasCacheHints.- Author:
- Tobias Pietzsch, Stephan Saalfeld, Philipp Hanslovsky
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceVolatileCachedCellImg.Get<T>static classVolatileCachedCellImg.VolatileCachedCells<T>-
Nested classes/interfaces inherited from class net.imglib2.img.cell.AbstractCellImg
net.imglib2.img.cell.AbstractCellImg.CellImgSampler<C extends Object>
-
-
Field Summary
-
Fields inherited from class net.imglib2.img.cell.AbstractCellImg
cells, grid
-
Fields inherited from class net.imglib2.img.AbstractNativeImg
entitiesPerPixel, linkedType, numEntities
-
Fields inherited from class net.imglib2.img.AbstractImg
dimension, max, n, numPixels
-
-
Constructor Summary
Constructors Constructor Description VolatileCachedCellImg(net.imglib2.img.cell.CellGrid grid, net.imglib2.util.Fraction entitiesPerPixel, Function<net.imglib2.img.NativeImg<T,? super A>,T> typeFactory, net.imglib2.cache.volatiles.CacheHints cacheHints, VolatileCachedCellImg.Get<net.imglib2.img.cell.Cell<A>> get)Deprecated.Construct with aVolatileCacheusingVolatileCachedCellImg(CellGrid, NativeType, CacheHints, VolatileCache).VolatileCachedCellImg(net.imglib2.img.cell.CellGrid grid, T type, net.imglib2.cache.volatiles.CacheHints cacheHints, VolatileCachedCellImg.Get<net.imglib2.img.cell.Cell<A>> get)Deprecated.Construct with aVolatileCacheusingVolatileCachedCellImg(CellGrid, NativeType, CacheHints, VolatileCache).VolatileCachedCellImg(net.imglib2.img.cell.CellGrid grid, T type, net.imglib2.cache.volatiles.CacheHints cacheHints, net.imglib2.cache.volatiles.VolatileCache<Long,net.imglib2.img.cell.Cell<A>> cache)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description net.imglib2.img.Img<T>copy()net.imglib2.img.ImgFactory<T>factory()net.imglib2.cache.volatiles.VolatileCache<Long,net.imglib2.img.cell.Cell<A>>getCache()net.imglib2.cache.volatiles.CacheHintsgetDefaultCacheHints()voidsetCacheHints(net.imglib2.cache.volatiles.CacheHints cacheHints)Sethintson how to handle cell requests for this cache.-
Methods inherited from class net.imglib2.img.cell.AbstractCellImg
copyDataTo, cursor, getCellGrid, getCells, iterationOrder, localizingCursor, localizingSpliterator, randomAccess, spliterator, update
-
Methods inherited from class net.imglib2.img.AbstractNativeImg
createLinkedType, getType, setLinkedType
-
Methods inherited from class net.imglib2.img.AbstractImg
dimension, dimensions, max, max, max, min, min, min, numDimensions, numElements, randomAccess, realMax, realMax, realMax, realMin, realMin, realMin, size, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, 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.IterableRealInterval
firstElement, iterator, parallelStream, stream
-
Methods inherited from interface net.imglib2.img.NativeImg
getAccessType
-
Methods inherited from interface net.imglib2.RandomAccessible
getAt, getAt, getAt, randomAccess
-
Methods inherited from interface net.imglib2.RandomAccessibleInterval
size, view
-
Methods inherited from interface net.imglib2.RealInterval
maxAsDoubleArray, maxAsRealPoint, minAsDoubleArray, minAsRealPoint, realMax, realMax, realMin, realMin
-
-
-
-
Constructor Detail
-
VolatileCachedCellImg
public VolatileCachedCellImg(net.imglib2.img.cell.CellGrid grid, T type, net.imglib2.cache.volatiles.CacheHints cacheHints, net.imglib2.cache.volatiles.VolatileCache<Long,net.imglib2.img.cell.Cell<A>> cache)
-
VolatileCachedCellImg
@Deprecated public VolatileCachedCellImg(net.imglib2.img.cell.CellGrid grid, net.imglib2.util.Fraction entitiesPerPixel, Function<net.imglib2.img.NativeImg<T,? super A>,T> typeFactory, net.imglib2.cache.volatiles.CacheHints cacheHints, VolatileCachedCellImg.Get<net.imglib2.img.cell.Cell<A>> get)
Deprecated.Construct with aVolatileCacheusingVolatileCachedCellImg(CellGrid, NativeType, CacheHints, VolatileCache).
-
VolatileCachedCellImg
@Deprecated public VolatileCachedCellImg(net.imglib2.img.cell.CellGrid grid, T type, net.imglib2.cache.volatiles.CacheHints cacheHints, VolatileCachedCellImg.Get<net.imglib2.img.cell.Cell<A>> get)
Deprecated.Construct with aVolatileCacheusingVolatileCachedCellImg(CellGrid, NativeType, CacheHints, VolatileCache).
-
-
Method Detail
-
getCache
public net.imglib2.cache.volatiles.VolatileCache<Long,net.imglib2.img.cell.Cell<A>> getCache()
-
setCacheHints
public void setCacheHints(net.imglib2.cache.volatiles.CacheHints cacheHints)
Sethintson how to handle cell requests for this cache. The hints compriseLoadingStrategy, queue priority, and queue order.Whenever a cell is accessed its data may be invalid, meaning that the cell data has not been loaded yet. In this case, the
LoadingStrategydetermines when the data should be loaded:LoadingStrategy.VOLATILE: Enqueue the cell for asynchronous loading by a fetcher thread, if it has not been enqueued in the current frame already.LoadingStrategy.BLOCKING: Load the cell data immediately.LoadingStrategy.BUDGETED: Load the cell data immediately if there is enoughIoTimeBudgetleft for the current thread group. Otherwise enqueue for asynchronous loading, if it has not been enqueued in the current frame already.LoadingStrategy.DONTLOAD: Do nothing.
If a cell is enqueued, it is enqueued in the queue with the specified
queue priority. Priorities are consecutive integers 0 ... n-1, where 0 is the highest priority. Requests with priority i < j will be handled before requests with priority j.Finally, the
queue orderdetermines whether the cell is enqueued to the front or to the back of the queue with the specified priority.Note, that the queues are
clearedwhenever anew frameis rendered.- Parameters:
cacheHints- describe handling of cell requests for this cache. May benull, in which case the default hints are restored.
-
getDefaultCacheHints
public net.imglib2.cache.volatiles.CacheHints getDefaultCacheHints()
-
factory
public net.imglib2.img.ImgFactory<T> factory()
-
copy
public net.imglib2.img.Img<T> copy()
-
-