15. Appendices¶
Appendix A: JSON Schema Definitions¶
The normative schema for Zarr Vectors metadata is the JSON Schema published with the Zarr Vectors convention v0.1.0:
Schema: https://raw.githubusercontent.com/Andrew-Keenlyside/zarr-vectors/refs/tags/v0.1.0/schema.json
Convention: https://github.com/Andrew-Keenlyside/zarr-vectors/blob/v0.1.0/README.md
It validates one zarr.json document at a time and covers:
the
zarr_vectorsobject of every node, discriminated bykind(root,level,parametricand every array and family-group kind of §8.4);the
zarr_conventionsregistration on every node;the root’s
multiscalesblock (onelayoutentry per level, no non-identity transform);the enumerations:
geometry_types,links_convention,object_index_convention,cross_chunk_strategy,cross_level_storage,coarsening_method,encoding,store,layout,manifest_layout,manifest_block_dtypeand the capability tokens.
Rules that span nodes or fields — sid_ndim entries (one per axis), integer
chunk / bin ratios, multiscales assets matching the level groups,
parent_level chains, has_perm and offsets consistency, array
shapes matching the chunk grid — are not expressible in a per-node
schema; they are listed in §8 and
§13.2 and
checked by validators.
The reference implementation also keeps a LinkML model,
schema/zarr_vectors.linkml.yaml in zarr-vectors-py, from which a
JSON Schema, Pydantic models and other artefacts can be generated with
the standard gen-* LinkML generators. It models the zarr_vectors
objects only (not multiscales, zarr_conventions, proj:projjson
or ome). Where it and the convention’s schema disagree, the
convention’s schema wins.
Appendix B: Zarr Implementation Details¶
Zarr version: v3 only.
Per-array layout: each per-spatial-chunk array is a single vlen-bytes array over the level’s chunk grid, one cell per chunk, cell files at
c/<i>/<j>/<k>; the non-spatial arrays are single ragged or dense arrays at their logical path. Internal record framing (fragment-index, manifest-block, link-record streams) lives in project byte layouts inside each cell’s payload.Cell addressing: chunk at absolute coord
c→ cellc - chunk_grid_origin; occupied cells are listed in thenonempty_chunksfield of the array’szarr_vectorsobject.Sharding: optional, via Zarr v3’s native
sharding_indexedcodec or, on a store marked octree, the registeredoctree_shardingcodec (Appendix D). There is no shard format specific to Zarr Vectors.Node metadata: every Zarr Vectors node’s
zarr.jsoncarries one attribute,zarr_vectors, discriminated bykind, plus azarr_conventionsregistration, alongside the Zarr v3 standardnode_type/zarr_formatfields (§8).Variable-length bytes: per-chunk arrays,
groups,object_index/manifestsandparametric/namesuse the zarr-extensions variable-lengthbytesdata type with thevlen-bytescodec. zarr-python 3 spells the data type"variable_length_bytes"; readers MUST accept that spelling as well as"bytes".Multi-store hosting: stores work on any Zarr v3 store backend (LocalStore, FsspecStore over S3 / GCS / Azure Blob, in-memory, icechunk transactional stores, …).
Appendix C: Coordinate Reference Systems¶
A store’s CRS is the root attribute
proj:projjson, a PROJJSON object, as defined by the proj convention v0.1 (uuidf17cb550-5864-4468-aeb7-f3180cfb622f), which the root then registers inzarr_conventions(§8.8). A store without a CRS has neither.Writers write
proj:projjsononly, neverproj:codeorproj:wkt2. A reader MAY accept those two forms from other writers.The CRS applies to world positions: stored position plus the root’s
coordinate_offset(absent ⇒ zero).Axes are the root object’s
axeslist, using OME-Zarr RFC 4’s descriptor shape (name,type,unit). Per-axis units use UDUNITS-2 names ("micrometer","second", …). The format does not stamp placeholder unit strings — unknown units must be omitted.There are no per-level coordinate transforms: every level stores vertices in level-0 coordinates, and the root
multiscalesblock carries no transform (§8.10).
Appendix D: Compression Codec Reference¶
Default per-array codec pipelines (from
zarr_vectors.encoding.compression):
Array |
Dtype |
Compressor |
Shuffle |
|---|---|---|---|
|
user-declared (float or integer; see §7.1) |
Blosc(Zstd, clevel=5) |
BYTE-SHUFFLE |
|
user-declared |
Blosc(Zstd, clevel=5) |
BYTE-SHUFFLE |
|
user-declared |
Blosc(Zstd, clevel=5) |
BYTE-SHUFFLE |
|
opaque |
none — opaque bytes (see §11.4) |
— |
|
opaque |
none — opaque bytes (see §11.4) |
— |
|
user-declared integer (width chosen to fit |
Blosc(Zstd, clevel=5) |
BITSHUFFLE |
|
user-declared |
Blosc(Zstd, clevel=5) |
BYTE-SHUFFLE |
|
vlen-bytes (opaque manifest blob — §7.6) |
Blosc(Zstd, clevel=5) |
BYTE-SHUFFLE |
|
user-declared |
Blosc(Zstd, clevel=5) |
BYTE-SHUFFLE |
|
vlen-bytes (per-group |
Blosc(Zstd, clevel=5) |
BYTE-SHUFFLE |
|
user-declared |
Blosc(Zstd, clevel=5) |
BYTE-SHUFFLE |
Any of these may additionally be wrapped in a sharding codec by
supplying a shard_shape; sharding composes with the codec, it does
not replace it. Note that this table is the recommended pipeline —
the default is no compressor at all (see
§11.3).
Mesh stores may use Draco-encoded vertex+face co-encoding instead of
the raw Blosc pipeline; the vertices array’s encoding: "draco"
field flags this. Draco output is already compressed, so the Zarr
codec pipeline is left empty (or wrapped in a minimal pass-through
codec).
Marker codec¶
zarr_vectors_octree_chunks is a pass-through bytes -> bytes codec
that ends the cell codecs (inside any sharding codec) of every
per-chunk array on a level with octree chunks
(§6.5). It exists so that a
Zarr reader that does not know it refuses the array instead of reading
octree leaves as uniform cells.
Record framings¶
The fragment-index byte layout (§7.3) and manifest-block stream (§7.6) are not Zarr codecs: they are record framings inside each cell’s bytes.
Appendix E: Downsampling Algorithms¶
The reference implementation provides one coarsening strategy:
Per-object coarsening (
coarsening_method = "per_object"): each level’s vertices are produced by reducing each surviving object’s fragments to one metavertex per coarse-bin, with attribute reduction following the per-attribute convention (mean / mode / sum, declared in the array metadata). Object identity is preserved (preserves_object_ids = true); dropped objects leave empty manifest slots.
Future strategies (mesh edge-collapse decimation, skeleton path
simplification, streamline point reduction) plug into the same
coarsening_method slot; see zarr_vectors.multiresolution.
Appendix F: Query Patterns¶
Common access patterns and which arrays they touch:
Pattern |
Arrays read |
|---|---|
Bounding-box at one level |
|
Per-bin sub-chunk filter |
|
Single object reconstruction |
|
All objects in a group |
|
Per-object attribute query |
|
Enumerate occupied chunks |
the array’s |
Pyramid drill-down (fine → coarse) |
|
Links leaving chunk |
|
All links incident on chunk |
one cell read per offsets segment under |
Appendix G: Performance Considerations¶
Chunk size: larger chunks amortise per-chunk overhead at the cost of larger minimum-read units. Coarser pyramid levels may grow
chunk_shapeindependently of level 0.Bin grid: enabling a per-chunk bin grid (
base_bin_shape) lets point-cloud queries narrow to individual bins without decoding the whole chunk — important when `vertex_count_per_chunk100k`.
Fragment vs object granularity: fragments are the unit of pyramid coarsening and re-use. When objects are very small (one fragment apiece, like nuclei), fragments and objects correspond 1-to-1; when objects are very large (a neuron with 10⁵ vertices), fragments naturally chunk the object’s vertices.
Per-link attributes:
link_attributes/<name>/<delta>/<chunk>read cost scales with the number of link rows in the cell oflinks/<delta>/<offsets>— the same fragment index that partitions vertices partitions these attributes.
Appendix H: Extensibility¶
Custom geometry types: writers may add a new value to
geometry_typesoutside the canonical set (point_cloud,line,polyline,streamline,skeleton,graph,mesh), at the cost of dropping conformance-level checks for that geometry.Custom metadata: application metadata goes under the root’s
user_metadataattribute, one namespace per application, never insidezarr_vectors. Other conventions MAY add prefixed keys (proj:…). Within azarr_vectorsobject, readers should ignore fields they do not recognise; a node whosekindthey do not recognise should be rejected.Capability tokens: stores advertise optional features via
format_capabilities. Readers that don’t recognize a token must either treat the corresponding feature as absent or refuse to open the store. Features a reader cannot safely ignore are also listed inrequired_capabilities(§8.2).Version evolution: the format version (
zv_version) and the convention version (the tag in thezarr_conventionsURLs) are versioned independently. Readers refuse a newer minor format version (§8.12); no shim layer ships with the implementation. Appendix J records what each version changed.
Appendix I: References¶
TRX format specification: https://tee-ar-ex.github.io/trx-python/stable/trx_specifications.html
Zarr v3 specification: https://zarr-specs.readthedocs.io/
Zarr Vectors convention v0.1.0 (metadata layer; normative JSON Schema): https://github.com/Andrew-Keenlyside/zarr-vectors/blob/v0.1.0/README.md
Zarr Conventions specification: https://github.com/zarr-conventions/zarr-conventions-spec
multiscales convention v0.1: https://github.com/zarr-conventions/multiscales/blob/v0.1/README.md
proj convention v0.1: https://github.com/zarr-conventions/proj/blob/v0.1/README.md
OME-Zarr (NGFF) specification: https://ngff.openmicroscopy.org/ (RFC 4 axes; RFC 8 collections and nodes)
sharding_indexedcodec: https://zarr-specs.readthedocs.io/en/latest/v3/codecs/sharding-indexed/octree_shardingcodec (zarr-extensions registry; implementation zarr-octree): https://github.com/Andrew-Keenlyside/zarr-octreezarr-extensions variable-length
bytesdata type andvlen-bytescodec: https://github.com/zarr-developers/zarr-extensionsLinkML: https://linkml.io/
Neuroglancer precomputed mesh format: https://github.com/google/neuroglancer/blob/master/src/datasource/precomputed/meshes.md
Neuroglancer precomputed annotation format: https://github.com/google/neuroglancer/blob/master/src/datasource/precomputed/annotations.md (see Appendix K for the mapping to Zarr Vectors).
Appendix J: Change Log¶
This appendix is the only place in the specification that describes prior versions of the format. Sections 1-14 and the other appendices describe the current version only.
Each entry records one version bump. Patch versions (0.9.1–0.9.4) are additive: an older reader of the same minor version reads a store that does not use the new feature.
Migration¶
0.9.x → 0.10.0: in place, metadata only. Format 0.10.0 cells are
byte-for-byte those of 0.9.4, so a 0.9.x store migrates by rewriting
its zarr.json documents; no chunk is read or written. The reference
implementation does this with
zarr_vectors.building.migrate_metadata_0_10(path) (dry_run=True
counts the nodes it would rewrite). It rewrites every level, array and
parametric node first and the root last, so an interrupted run
leaves a store that is still refused as 0.9.x, and running it again
finishes the job. On a 0.10.0 store it changes nothing.
0.9.x |
0.10.0 |
|---|---|
Root |
The same object with |
Root |
Root |
Root |
Root |
Root |
|
Level |
Level |
Level |
The level object’s |
Array |
|
|
|
|
|
|
|
No registration |
|
A coarse level whose bins were stored only in its NGFF entry gets them
copied into its level object (bin_ratio = scale, bin_shape =
2 × translation). Fields added in 0.9.1–0.9.4 keep their names. A
0.9.x reader cannot read a migrated store.
Anything older than 0.9.0: rewrite from source. Every earlier bump
changed the cell layout. 0.10.0 is the first in-place migration since
the 0.7 → 0.8 helper, which is obsolete: 0.8 → 0.9 moved every
per-chunk array to a single vlen array over the chunk grid, and re-keyed
cross-chunk records by source chunk instead of by sorted endpoint
tuple, which cannot be recovered where perm_idx was not stored.
A reader MUST reject a store it cannot identify rather than read it on a best-effort basis (§13.2).
Version-at-a-glance¶
Version |
Headline change |
New capability tokens |
Hard break? |
Migration |
|---|---|---|---|---|
0.10.0 |
Metadata on the Zarr Vectors convention: one |
— |
Yes (metadata only; cells unchanged) |
In place, |
0.9.4 |
Optional dense object-index layout |
|
No (additive) |
None needed |
0.9.3 |
Optional root |
— |
No (additive) |
None needed |
0.9.2 |
Optional RFC 8 |
— |
No (additive) |
|
0.9.1 |
Optional root |
— |
No (additive) |
None needed |
0.9 |
Single vlen array per per-chunk array (cells over the chunk grid); |
— (retires |
Yes |
Rewrite |
0.8.1 |
Flat single-array layout for the dense / ragged arrays; |
— |
Yes |
Rewrite |
0.8 |
Partitioned |
|
Yes |
In-place helper (obsoleted by 0.9) |
0.7 |
Per-level |
— |
Yes |
Rewrite |
0.6 |
Fragment-index byte layout for |
|
Yes |
Rewrite |
0.5 |
NGFF axis alignment; |
— |
Yes |
Rewrite |
0.4.1 |
Bare-integer level group names ( |
— |
Yes (path-only) |
Rewrite |
0.4 |
|
|
Yes |
Rewrite |
Cumulative capability set as of v0.10¶
A v0.10 store may carry any subset of:
multiscale_links—delta ≠ 0link arrays present (since 0.4; since 0.9 it says nothing about chunk-spanning records);shared_fragments— fragments referenced by several manifests (renamed fromshared_vertex_groupsin 0.6);preserved_object_ids— a level kept its parent’s OID space (since 0.4);dense_manifests— adense_manifests_v1object index (0.9.4);octree_sharding— sharded arrays use theoctree_shardingcodec (0.9.4);octree_chunks— a level has octree chunks; also inrequired_capabilities(0.9.4);fragment_index— reserved: defined since 0.6, mandatory in meaning, never written by the reference implementation.
Tokens are open-set; readers must tolerate unknown values.
Per-version detail¶
0.10.0 — the metadata moves onto the Zarr Vectors convention v0.1.0. Cell payloads are unchanged from 0.9.4.
Every node’s Zarr Vectors properties sit under one attribute,
zarr_vectors, discriminated bykind:root,level,parametric, or an array kind. Array fields (dtype,name,nonempty_chunks, …) move inside it;zarr_vectors_levelbecomeszarr_vectorswithkind: "level", and the level’szarr_vectors_presencebecomes itspresencefield. Two array kinds are renamed:attribute→vertex_attribute,groupings_attribute→group_attribute.zarr_conventionsregisters the convention on every such node, and the multiscales (and, with a CRS, proj) conventions on the root.Axes move from NGFF
multiscales[0].axesintozarr_vectors.axes.The bare-root OME-NGFF 0.4
multiscaleslist — which pointeddatasetsat groups and reusedscale/translationfor bin geometry — is replaced by the multiscales convention’s{"layout": [{"asset": "<level>"}]}with no transform. A coarse level’sbin_shapeandbin_ratiolive only in its level object.crsleaves the root object forproj:projjson.Readers refuse 0.9.x stores (naming the migration) and stores with a newer minor version. Migration: in place (see Migration).
Additive in the same release: a
delta = 0links family may declareelement(tetra,pyramid,wedge,hexahedron), making each record a volume-mesh cell rather than an edge or polygon face (§10.6.6).
0.9.4 — optional dense object-index layout,
dense_manifests_v1:object_index/manifest_spans(int64 (n_objects, 2), start and count) indexingobject_index/manifest_blocks(int64 (n_blocks, sid_ndim + 1), chunk coordinates then fragment index, one row per fragment an object references), withobject_index/object_idsas invlen_manifests_v2. Chosen per store by the root’smanifest_layout: "dense"(absent means vlen, so every 0.9.3 store reads unchanged;manifest_block_dtype: "int32"narrows the blocks) and declared bydense_manifests. A 0.9.3 reader rejects the unknownlayoutrather than misreading it. Also shipped under 0.9.4: the root’soctree_shardingblock and capability (sharded arrays use zarr-octree’s codec, then namedzarr_octree_sharding), octree-chunked levels (octree_chunkscapability, leveloctree_chunksblock, marker codec), and the root’srequired_capabilities. Migration: none.0.9.3 — optional root
shard_shape: cells per shard per axis, an integer when every axis agrees. It records the store’s packing for every path that allocates an array, including arrays a worker creates later; each array’s ownzarr.jsonremains the truth. Absent ⇒ unsharded, so 0.9.0–0.9.2 stores read unchanged. Also: theomescene’sworldcoordinate system gainsidbesidename; and a per-chunk array may omitnonempty_chunkswhile its level declares presence"deferred"(then a top-levelzarr_vectors_presenceattribute), a build-time state a coordinator ends. A finished store is readable by a 0.9.2 reader; one caught mid-build is not (that reader treats the missing list as an empty array). Migration: none.0.9.2 — optional root
omeblock: an OME-Zarr RFC 8collectionnode (version,type,name, onezv:levelleaf per level, and ascenedeclaring theworldcoordinate system with the store’s axes and units), so an OME collection elsewhere can name the store by path. Every field restates one inzarr_vectorsormultiscales, which stay authoritative. Migration: none, orstamp_ome_nodeto add the block in place.0.9.1 — optional root
attribute_specs: declared attributes by scope ({"vertex": {"intensity": {"dtype": "float32", "unit": "microvolt"}}, "object": {…}, "link": {…}}). A declaration is not a promise that the array exists;unitanddescriptionare also stamped on the attribute array when written. Also shipped under 0.9.1: thevlen_manifests_v2object-index layout, which stores object ids inobject_index/object_idsinstead of implying them by row. Migration: none.0.9.0 — two independent on-disk breaks, shipped together. One array per logical array: every per-spatial-chunk array becomes one Zarr v3 vlen-bytes array over the level’s chunk grid, one cell per spatial chunk at
<array>/c/<i>/<j>/<k>, replacing one single-chunkuint8sub-array per spatial chunk. Cells are offset bychunk_grid_origin(absent ⇒ zero), occupied cells are listed innonempty_chunks, and an optionalshard_shapewraps the cells insharding_indexed. One connectivity family:cross_chunk_linksandcross_chunk_link_attributesmerge intolinksandlink_attributes.links/<delta>becomes a group with one vlen array per relative-offset segment (links/<delta>/<offsets>, cell = the record’s source chunk), mirrored bylink_attributes/<name>/<delta>/<offsets>.partitioned_cross_chunk_linksis retired andmultiscale_linksnarrows to “delta ≠ 0arrays are present”. Migration: rewrite.0.8.1 — each non-spatial array (
object_attributes,group_attributes,groups, parametric blobs) becomes a single Zarr v3 array at its logical path instead of a group with adatachild. Sparse coverage moves from apresent_masksibling to the array’sfill_value; ragged arrays move to vlen-bytes; custom per-array attributes move onto the array. Also adds optionaldirected,storeandnum_physical_recordsto the cross-chunk link family. Migration: rewrite.0.8.0 — the monolithic
cross_chunk_links/<delta>/datablob is replaced by one sharded vlen arraykKper endpoint-chunk count K, one cell per sorted-unique chunk tuple, records of9 * link_widthbytes with a per-endpoint chunk index;layout = "sharded_v1"on the family group; newpartitioned_cross_chunk_linkstoken (coupled withmultiscale_links). Migration: an in-place helper, now obsolete.0.7.0 — optional per-level
chunk_shape, a positive integer multiple of the rootchunk_shapeon every axis (nested grids). Migration: rewrite.0.6.0 — fragment-index byte layout:
vertex_group_offsetsis replaced byvertex_fragments; the inlinedelta = 0link blob is split into flatlinks/0/<chunk>plus alink_fragmentssidecar;object_index/dataadopts the manifest-block encoding.shared_vertex_groupsis renamedshared_fragments;fragment_indexis introduced. Migration: rewrite.0.5.0 — NGFF alignment and simplification:
format_version→zv_version; axes move to NGFFmultiscales[0].axes; per-array dtype duplication dropped;vertex_counts/,metanode_children/,cross_chunk_faces/,attributes/<name>/<key>_offsetsandobject_index/pending/removed; flat(K,)vertex offsets; cross-chunk faces move tocross_chunk_links/<delta>/withlink_width = 3. Migration: rewrite.0.4.1 — level groups renamed
resolution_<n>/→<n>/. Path-only break. Migration: rename level groups.0.4 —
<delta>sub-folders forlinks/,cross_chunk_links/and their attribute families; cross-pyramid-level link arrays;cross_level_depth/cross_level_storage;multiscale_linkstoken. Migration: rewrite.
Appendix K: Mapping from Neuroglancer Precomputed Annotations¶
The Neuroglancer precomputed annotation format stores small geometric primitives — points, lines, axis-aligned bounding boxes, and ellipsoids — with per-annotation properties, per-segment relationships, and a multi-resolution random-subsample spatial index. It serves a similar purpose to Zarr Vectors but with narrower geometry semantics and a different multi-resolution model. This appendix maps the two layouts so authors can pick the right target and converters can translate between them.
K.1 Conceptual mapping¶
Neuroglancer Precomputed Annotations |
Zarr Vectors equivalent |
|---|---|
|
root |
|
|
|
Root |
|
|
|
|
|
|
|
Pyramid levels |
|
Per-level effective |
|
Implicit via vertex count / bin_shape; pyramid coarsening controlled by |
Sharded vs unsharded |
Zarr v3 chunk-key encoding handles both transparently; sharding is a backend concern, not a schema choice |
Random subsampling between levels |
|
K.2 Mapping the four geometry primitives¶
Precomputed annotations are zero-dimensional primitives, each carrying
a fixed positional record. Zarr Vectors expresses them via the
geometry_types list plus the appropriate per-record layout:
Precomputed |
Positional record |
Zarr Vectors representation |
|---|---|---|
|
1 vector |
|
|
2 vectors (endpoint A, B) |
|
|
2 vectors (min, max) |
Two options. (a) |
|
2 vectors (center, radii) |
|
|
uint32 count + N vectors |
|
Multi-geometry stores are natural in Zarr Vectors (just list every
geometry in geometry_types); the precomputed format restricts a
single store to one annotation_type and would require co-locating
several stores to mix kinds.
K.3 Properties and relationships¶
Per-annotation properties in precomputed correspond directly to per-vertex (or per-object) attributes:
Numeric properties (
uint8,int8, …,float32) → typedvertex_attributes/<name>/<chunk>orobject_attributes/<name>. Zarr Vectors uses the array’sdtypedirectly; no per-property enum table is needed at the schema level.rgb/rgba→ either an(N, 3)/(N, 4)uint8 attribute, or three / four channels of a multi-channel attribute with declaredchannel_names.enum_values/enum_labels→ carried aschannel_names/ per-attribute side metadata. Zarr Vectors does not currently reserve a top-level enum-mapping slot; writers stamp the mapping as a JSON dict in the attribute array’szarr_vectorsobject.
Relationships (each annotation linked to a list of segment IDs) map onto Zarr Vectors groups:
The precomputed
relationships[<rel_name>]becomes a per-relationshipgroupsarray (or, if multiple relationships, onegroups-like structure per relationship name — typically expressed today by rechunking by relationship; see §8).Each group corresponds to one segment id. Its membership list is the annotation IDs (= object IDs in Zarr Vectors).
The inverse — annotation → list of segments — is then the group-membership matrix (which annotations belong to which groups); in Zarr Vectors this is recovered by iterating
groups, the same operation that powers “show all annotations on segment X” in precomputed.
K.4 The spatial index¶
Both formats use a multi-resolution spatial grid to keep query cost bounded, but the selection rule differs:
Precomputed: each level has a per-cell
limit. A cell with more annotations than the limit gets a random subsample at this level; the rest propagate to finer children. Cell coverage is controlled bygrid_shape×chunk_size, anchored atlower_bound. Levels coarsen by integer division of cells.Zarr Vectors: each level has a fixed
bin_shape(and optionally an overriddenchunk_shape). Coarsening is per-object: each surviving object’s vertices are aggregated into metavertices at the coarser bin grid.object_sparsity ∈ (0, 1]in level metadata records what fraction of objects survived.
Equivalents:
Concept |
Precomputed |
Zarr Vectors |
|---|---|---|
Grid cells per axis at level L |
|
|
Cell size at level L |
|
root |
LOD selection knob |
|
|
Cross-level identity |
annotation ID is shared across levels |
OID-preserving pyramid ( |
Drillable parent→child mapping |
implicit (random subsample) |
optional |
Precomputed’s “drill the visible cells until you’ve returned at most
limit annotations per cell” maps to Zarr Vectors’ “ask each level
for the object set; stop when object_sparsity * source_count fits
your budget.” The precomputed model is simpler and gets random
sampling for free; the Zarr Vectors model is more general (handles
extended objects, not just points) at the cost of an explicit
coarsener.
K.5 Practical conversion notes¶
Single annotation type → single Zarr Vectors store is a straightforward 1:1 transcode. Pick the geometry mapping from §K.2; emit one fragment per annotation; populate
object_index/in dense OID order from the originalby_idlisting.Properties transcode field-for-field; preserve the original uint8 / int8 / … types rather than upcasting.
Relationships transcode to groups keyed by segment id. In practice, very large segment-id spaces (10⁸+ segments) suggest using
object_attributes/segment_idrather thangroupsif most segments touch zero or one annotation.Spatial index does NOT transcode 1:1. The pyramid is rebuilt using the per-object coarsener; the precomputed
limitrule has no direct Zarr Vectors equivalent. A reasonable default isreduction_factor = 8,object_sparsity ≈ limit / max_cell_countper level, andcross_level_storage = "implicit"if downstream readers need to drill from coarse to fine.Sharded vs unsharded is invisible to the schema mapping — Zarr Vectors writes per-chunk blobs into a Zarr v3 store regardless of the backend’s sharding.
K.6 What Zarr Vectors adds over precomputed annotations¶
Connected geometries (polylines with branches, skeletons, meshes) live in the same store, not just zero-dimensional primitives.
link_width = 1, 2, 3, ...and the fragment-index partitioning carry the connectivity.Fragment / vertex re-use: explicit fragment indices let multiple objects reference the same per-chunk vertex rows (
shared_fragments), saving storage on overlapping geometries (streamline bundles, mesh rims).Per-link attributes: edges / faces carry their own attribute arrays (
link_attributes/<name>/<delta>/<chunk>), not just the per-annotation properties precomputed supports.Cross-pyramid-level links (§9.6) make the pyramid drillable — given a coarse metavertex, walk back to the fine-level vertices that produced it. Precomputed’s random-subsample model loses this mapping at construction time.
Pluggable coarsening:
coarsening_method = "per_object"is the default, but mesh decimation and streamline point-reduction slot into the same level structure.
K.7 What precomputed annotations preserve that Zarr Vectors does not (yet)¶
Sharded back-end as a first-class schema concern. Zarr Vectors delegates sharding to the underlying Zarr v3 store; it does not expose
shardingblocks per index.Per-property enum tables as a typed schema field (
enum_values/enum_labels). Zarr Vectors carries this as free-form array metadata.The “limit” LOD heuristic — automatic, occupancy-driven downsampling without writing a coarsening pass. In Zarr Vectors the writer must pick
bin_ratio/chunk_scale_factor/object_sparsitydeliberately.