public class OpenConnectomeVolatileArrayLoader extends Object implements CacheArrayLoader<VolatileByteArray>
Constructor and Description |
---|
OpenConnectomeVolatileArrayLoader(String baseUrl,
String token,
String mode,
long zMin)
Create a
CacheArrayLoader for a source provided by the
Open
Connectome Volume Cutout Service. |
Modifier and Type | Method and Description |
---|---|
int |
getBytesPerElement()
How many bytes does one element (voxel) occupy? This is used only for
statistics, i.e., estimating I/O bandwidth.
|
VolatileByteArray |
loadArray(int timepoint,
int setup,
int level,
int[] dimensions,
long[] min)
Load cell data into memory.
|
VolatileByteArray |
tryLoadArray(int timepoint,
int setup,
int level,
int[] dimensions,
long[] min) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getEmptyArrayCreator
public OpenConnectomeVolatileArrayLoader(String baseUrl, String token, String mode, long zMin)
Create a CacheArrayLoader
for a source provided by the
Open
Connectome Volume Cutout Service.
It is created with a base URL, e.g. http://openconnecto.me/ocp/ca/kasthuri11 the cell dimensions, and an offset in z. This offset constitutes the 0-coordinate in z and should point to the first slice of the dataset.
baseUrl
- e.g.
http://openconnecto.me/ocp/catoken
- e.g. "kasthuri11"mode
- z-scaling mode, either of [null, "", "neariso"]zMin
- first z-index at scale level 0public int getBytesPerElement()
CacheArrayLoader
getBytesPerElement
in interface CacheArrayLoader<VolatileByteArray>
public VolatileByteArray loadArray(int timepoint, int setup, int level, int[] dimensions, long[] min) throws InterruptedException
CacheArrayLoader
InterruptedException
is thrown.
Parameters specify the image within the data set and the location of the
cell within the image: timepoint
, setup
, and
level
define the stack, where setup is a combination of angle,
channel, etc., and level is the resolution level (for multi-resolution
data). dimensions
is the size of the block to load (in voxels).
min
is the starting coordinate of the block in the stack (in
voxels).
Usually, the CacheArrayLoader
interface is implemented in
conjunction with implementing a ViewerImgLoader
for 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 your ViewerImgLoader
. For an example, look at
CatmaidImageLoader
. 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 the
CatmaidImageLoader
provides. Therefore, all calls to
CacheArrayLoader.loadArray(int, int, int, int[], long[])
will have predictable
dimensions
(corresponding to tile size of the data set) and
min
offsets (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)
loadArray
in interface CacheArrayLoader<VolatileByteArray>
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).InterruptedException
public VolatileByteArray tryLoadArray(int timepoint, int setup, int level, int[] dimensions, long[] min) throws InterruptedException
InterruptedException
Copyright © 2015–2021 Fiji. All rights reserved.