Skip to content

Scalable storage for points, streamlines, graphs, skeletons and meshes

Zarr Vectors is a format for N-dimensional vector data on Zarr v3, built to scale. Space is split into chunks, so a reader fetches only the chunks a region touches and separate writers can fill different chunks at once, on a local disk or in S3, GCS or Azure.

pip install zarr-vectors
Move over the store to query a region
One model

Every geometry is vertices, links and objects

Vertices sit in spatial chunks. Links join them, inside a chunk or across its border. Objects are lists of fragments across chunks. Points, streamlines, skeletons, graphs and meshes differ only in how they use these.

Point clouds

Vertices with any attributes you need: cells, nuclei, microscopy and LiDAR points. A box query returns exactly the points inside it.

Point clouds in the spec

Streamlines

Ordered vertices per object, as in tractography. A box query returns every whole streamline that passes through it.

Streamlines in the spec

Skeletons

Branching links per object, such as neurons in connectomics. A link that crosses a chunk border records which neighbouring chunk its other end lives in.

Skeletons in the spec

Graphs

Vertices and links of any shape. Numbering is local to each chunk, so separate writers can fill different chunks with no global vertex IDs.

Graphs in the Python docs

Meshes

Triangle, quad or tetrahedral faces, stored as links three or four vertices wide, or Draco-encoded chunk by chunk.

Meshes in the spec
Built-in pyramids

Every scale, from one store

Each coarser level doubles the bin size and merges the vertices in each bin into one at their centroid, so a viewer reads only the level it needs. The levels carry OME-Zarr multiscale metadata, so any viewer can find them.

Building pyramids in Python

Start here

Write a store, read a region

Create a store, write points, read back one box and build coarser levels. The same calls work for every geometry, on a local disk or in the cloud.

import numpy as np
import zarr_vectors as zv

schema = zv.Schema(
    bounds=((0.0, 0.0, 0.0), (1000.0, 1000.0, 1000.0)),
    kind="point_cloud",
    layout=zv.Layout(cells=5),
)
ds = zv.create("scan.zarrvectors", schema=schema)
rng = np.random.default_rng(42)
ds.add_points(rng.uniform(0, 1000, size=(100_000, 3)).astype(np.float32))

# reads only the chunks the box touches
r = ds.select(bbox=((100, 100, 100), (200, 200, 200))).read()

# two coarser levels, each doubling the bin size
ds.build_pyramid(factors=[(2.0, 1.0), (2.0, 1.0)])

See your data in ngplatform

ngplatform is a workspace around Neuroglancer. It opens Zarr, OME-Zarr and Zarr Vectors datasets in the browser, from cloud storage or from files on your computer.

Ecosystem

The format, its libraries and what is built on it

Zarr Vectors specification

core
AllenInstitute/zarr_vectors

The format itself: store layout, arrays, metadata, spatial indexing, multi-resolution, cross-chunk links, encodings and conformance. A draft, released to start the conversation.

Zarr convention

convention
Andrew-Keenlyside/zarr-vectors

The metadata layer of the format, proposed as a Zarr convention: a JSON schema and validator for the attributes that mark a node as part of a Zarr Vectors store. It does not define the cell encodings; the specification does.

zarr-vectors

core
AllenInstitute/zarr-vectors-py

The Python library: open a store, select a region or a set of objects, read and edit it; build stores with ingest converters, pyramid builders and exporters. Local disk, S3, GCS or Azure.

zarr-vectors-tools

core
AllenInstitute/zarr-vectors-tools

Converters and workflows on top of zarr-vectors: CSV, PLY, LAS, TRK, TRX, SWC, OBJ, GIfTI, Neuroglancer precomputed and more, with resolution pyramids and the zvtools command line.

zarr-octree

extension
Andrew-Keenlyside/zarr-octree

A sharding codec that groups neighbouring chunks along an octree's Z-order into objects of bounded size, without changing the chunk grid Zarr sees. Built for point clouds in zarr-vectors.

ngplatform

viewer
AllenInstitute/ngplatform

A workspace around Neuroglancer that shows Zarr, OME-Zarr and Zarr Vectors datasets, with plugins for track filtering, registration, annotation and segmentation. Runs in the browser.

zvCFD

application
Andrew-Keenlyside/zvCFD

GPU computational fluid dynamics, with every geometry, mesh and result held in Zarr Vectors stores.

zvDVC

application
Andrew-Keenlyside/zvDVC

GPU digital volume correlation for tomography too large for existing tools. Search points and results live in Zarr Vectors stores, whose chunk grid is its unit of work.