Package bdv.img.cache

Interface SimpleCacheArrayLoader<A extends net.imglib2.img.basictypeaccess.DataAccess>

  • Type Parameters:
    A - type of access to cell data, currently always a VolatileAccess.

    public interface SimpleCacheArrayLoader<A extends net.imglib2.img.basictypeaccess.DataAccess>
    Provider of volatile Cell data. This is implemented by data back-ends to the VolatileGlobalCellCache.

    SimpleCacheArrayLoader is supposed to load data one specific image. loadArray() will not get information about which timepoint, resolution level, etc a requested block belongs to.

    This is in contrast to CacheArrayLoader, where all information to identify a particular block in a whole dataset is provided. Whether it makes more sense to implement CacheArrayLoader or SimpleCacheArrayLoader depends on the particular back-end.

    Author:
    Tobias Pietzsch
    • Method Detail

      • getEmptyArrayCreator

        default EmptyArrayCreator<A> getEmptyArrayCreator()
        Implementing classes must override this if A is not a standard VolatileArrayDataAccess type. The default implementation returns null, which will let CreateInvalidVolatileCell.get(...) try to figure out the appropriate DefaultEmptyArrayCreator.

        Default access types are

        • DirtyVolatileByteArray
        • VolatileByteArray
        • DirtyVolatileCharArray
        • VolatileCharArray
        • DirtyVolatileDoubleArray
        • VolatileDoubleArray
        • DirtyVolatileFloatArray
        • VolatileFloatArray
        • DirtyVolatileIntArray
        • VolatileIntArray
        • DirtyVolatileLongArray
        • VolatileLongArray
        • DirtyVolatileShortArray
        • VolatileShortArray
        Returns:
        an EmptyArrayCreator for A or null.
      • loadArray

        A loadArray​(long[] gridPosition,
                    int[] cellDimensions)
             throws IOException
        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, an IOException is thrown.

        SimpleCacheArrayLoader is supposed to load data one specific image. loadArray() will not get information about which timepoint, resolution level, etc a requested block belongs to.

        This is in contrast to CacheArrayLoader.loadArray(int, int, int, int[], long[]), where all information to identify a particular block in a whole dataset is provided.

        Parameters:
        gridPosition - the coordinate of the cell in the cell grid.
        cellDimensions - the dimensions of the cell.
        Returns:
        loaded cell data.
        Throws:
        IOException