This is an implementation of the Zarr N5 specification for the BossDB spatial database.
N5 is a growing standard for interacting with large volumetric datasets. Here, we implement the N5 standard backed by BossDB. Data requests are proxied to the BossDB API (https://api.bossdb.io). This allows users to interact with BossDB data through the standard N5 interface, which improves tool interoperability.
poetry installpoetry run serveConsider accessing the N5 / Zarr data with Neuroglancer by creating a channel with the following source:
n5://http://localhost:5020/api/witvliet2020/Dataset_1/em
See bossdbzarr/endpoints.py for more details.
/api/<collection>/<experiment>/<channel>/attributes.json{
"pixelResolution": {
"dimensions": [*voxel_shape, 1],
"unit": "nm",
},
"ordering": "C",
"scales": [[2**s, 2**s, 1, 1] for s in range(4)],
"axes": ["x", "y", "z", "c"],
"units": ["nm", "nm", "nm", ""],
"translate": [0, 0, 0, 0],
}/api/<collection>/<experiment>/<channel>/s<int:scale>/attributes.json{
"transform": {
"ordering": "C",
"axes": ["x", "y", "z", "c"],
"scale": [
2**scale, # * 2**scale,
2**scale, # * 2**scale,
2**scale,
1,
],
"units": ["nm", "nm", "nm"], # TODO
"translate": [0.0, 0.0, 0.0],
},
"compression": {"type": "gzip", "useZlib": False, "level": -1},
"blockSize": [*BLOCK_SIZE.tolist(), 1],
"dataType": dtype,
"dimensions": [*shape[::-1], 1],
}/api/<collection>/<experiment>/<channel>/s<int:scale>/<int:chunk_x>/<int:chunk_y>/<int:chunk_z>/<int:chunk_c>(Encoded Zarr Gzip data)