This is an implementation of the Zarr N5 specification and OME-Zarr specification for the BossDB spatial database.
Zarr is a growing standard for interacting with large volumetric datasets. Here, we implement Zarr data access 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 or OME interfaces, which improves tool interoperability.
uv sync uv run app.pyConsider accessing the N5 or OME Zarr data with Neuroglancer by creating a channel with the following source:
n5://http://localhost:5020/api/witvliet2020/Dataset_1/em
zarr://http://localhost:5020/ome/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)
See bossdbzarr/ome_endpoints.py for more details.
/ome/<collection>/<experiment>/<channel>/.zgroup/ome/<collection>/<experiment>/<channel>/.zattrs/ome/<collection>/<experiment>/<channel>/<int:scale>/.zarray/ome/<collection>/<experiment>/<channel>/<int:scale>/.zattrs/ome/<collection>/<experiment>/<channel>/<int:scale>/<path:chunk_key>