Interface CacheArrayLoader<A extends net.imglib2.img.basictypeaccess.DataAccess>
-
- Type Parameters:
A- type of access to cell data, currently always aVolatileAccess.
- All Known Implementing Classes:
CatmaidVolatileIntArrayLoader,ImarisVolatileByteArrayLoader,ImarisVolatileFloatArrayLoader,ImarisVolatileShortArrayLoader,OpenConnectomeVolatileArrayLoader,RemoteVolatileShortArrayLoader
public interface CacheArrayLoader<A extends net.imglib2.img.basictypeaccess.DataAccess>Provider of volatileCelldata. This is implemented by data back-ends to theVolatileGlobalCellCache.- Author:
- Tobias Pietzsch
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default intgetBytesPerElement()How many bytes does one element (voxel) occupy?default EmptyArrayCreator<A>getEmptyArrayCreator()Implementing classes must override this ifAis not a standardVolatileArrayDataAccesstype.AloadArray(int timepoint, int setup, int level, int[] dimensions, long[] min)Load cell data into memory.
-
-
-
Method Detail
-
getBytesPerElement
default int getBytesPerElement()
How many bytes does one element (voxel) occupy? This is used only for statistics, i.e., estimating I/O bandwidth. Implementing classes can return an estimate if element size is varying or unknown.- Returns:
- number of bytes required to store one element.
-
getEmptyArrayCreator
default EmptyArrayCreator<A> getEmptyArrayCreator()
Implementing classes must override this ifAis not a standardVolatileArrayDataAccesstype. The default implementation returnsnull, which will letCreateInvalidVolatileCell.get(...)try to figure out the appropriateDefaultEmptyArrayCreator.Default access types are
DirtyVolatileByteArrayVolatileByteArrayDirtyVolatileCharArrayVolatileCharArrayDirtyVolatileDoubleArrayVolatileDoubleArrayDirtyVolatileFloatArrayVolatileFloatArrayDirtyVolatileIntArrayVolatileIntArrayDirtyVolatileLongArrayVolatileLongArrayDirtyVolatileShortArrayVolatileShortArray
- Returns:
- an
EmptyArrayCreatorforAor null.
-
loadArray
A loadArray(int timepoint, int setup, int level, int[] dimensions, long[] min) throws InterruptedException
Load cell data into memory. This method blocks until data is successfully loaded. If it completes normally, the returned data is always valid. If anything goes wrong, anInterruptedExceptionis thrown.Parameters specify the image within the data set and the location of the cell within the image:
timepoint,setup, andleveldefine the stack, where setup is a combination of angle, channel, etc., and level is the resolution level (for multi-resolution data).dimensionsis the size of the block to load (in voxels).minis the starting coordinate of the block in the stack (in voxels).Usually, the
CacheArrayLoaderinterface is implemented in conjunction with implementing aViewerImgLoaderfor a BDV data back-end. You do not need to be able to load blocks of arbitrary sizes and offsets here -- just the ones that you will use from the images returned by yourViewerImgLoader. For an example, look atCatmaidImageLoader. There, the blockDimensions are defined in the constructor, according to the tile size of the data set. These blockDimensions are then used for every image that theCatmaidImageLoaderprovides. Therefore, all calls toloadArray(int, int, int, int[], long[])will have predictabledimensions(corresponding to tile size of the data set) andminoffsets (multiples of the tile size).The only exception to this rule is at the (max) border of the stack. The boundary cells may have a truncated shape. For example, if your image size is 20x20x1 and your cell size is 16x16x1, you will have cell sizes
(16x16x1), (4x16x1)
(16x4x1), (4x4x1)- Parameters:
timepoint- the timepoint of the stack.setup- the setup of the stack.level- the resolution level of the stack (0 for full resolution).dimensions- the size of the block to load (in voxels).min- the min coordinate of the block in the stack (in voxels).- Returns:
- loaded cell data.
- Throws:
InterruptedException
-
-