- java.lang.Object
-
- bdv.img.catmaid.CatmaidVolatileIntArrayLoader
-
- All Implemented Interfaces:
CacheArrayLoader<net.imglib2.img.basictypeaccess.volatiles.array.VolatileIntArray>
public class CatmaidVolatileIntArrayLoader extends Object implements CacheArrayLoader<net.imglib2.img.basictypeaccess.volatiles.array.VolatileIntArray>
-
-
Constructor Summary
Constructors Constructor Description CatmaidVolatileIntArrayLoader(String urlFormat, int tileWidth, int tileHeight, int[] zScales)Create aCacheArrayLoaderfor a CATMAID source.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetBytesPerElement()How many bytes does one element (voxel) occupy?net.imglib2.img.basictypeaccess.volatiles.array.VolatileIntArrayloadArray(int timepoint, int setup, int level, int[] dimensions, long[] min)Load cell data into memory.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface bdv.img.cache.CacheArrayLoader
getEmptyArrayCreator
-
-
-
-
Constructor Detail
-
CatmaidVolatileIntArrayLoader
public CatmaidVolatileIntArrayLoader(String urlFormat, int tileWidth, int tileHeight, int[] zScales)
Create a
CacheArrayLoaderfor a CATMAID source. Tiles are addressed, in this order, by their- scale level,
- scale,
- x,
- y,
- z,
- tile width,
- tile height,
- tile row, and
- tile column.
urlFormatspecifies how these parameters are used to generate a URL referencing the tile. Examples:- "http://catmaid.org/my-data/xy/%5$d/%8$d_%9$d_%1$d.jpg"
- CATMAID DefaultTileSource (type 1)
- "http://catmaid.org/my-data/xy/?x=%3$d&y=%4$d&width=%6d&height=%7$d&row=%8$d&col=%9$d&scale=%2$f&z=%4$d"
- CATMAID RequestTileSource (type 2)
- "http://catmaid.org/my-data/xy/%1$d/%5$d/%8$d/%9$d.jpg"
- CATMAID LargeDataTileSource (type 5)
- Parameters:
urlFormat-tileWidth-tileHeight-
-
-
Method Detail
-
getBytesPerElement
public int getBytesPerElement()
Description copied from interface:CacheArrayLoaderHow 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.- Specified by:
getBytesPerElementin interfaceCacheArrayLoader<net.imglib2.img.basictypeaccess.volatiles.array.VolatileIntArray>- Returns:
- number of bytes required to store one element.
-
loadArray
public net.imglib2.img.basictypeaccess.volatiles.array.VolatileIntArray loadArray(int timepoint, int setup, int level, int[] dimensions, long[] min) throws InterruptedException
Description copied from interface:CacheArrayLoaderLoad 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 toCacheArrayLoader.loadArray(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)- Specified by:
loadArrayin interfaceCacheArrayLoader<net.imglib2.img.basictypeaccess.volatiles.array.VolatileIntArray>- 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
-
-