Constants¶
Geometry type string constants. Import these instead of using raw strings to ensure forward-compatibility if constant values change.
Format constants for the Zarr Vectors (ZV) format.
These are the canonical names, prefixes, and default values used throughout the specification. Changing a value here changes it everywhere in the package.
- zarr_vectors.constants.CAP_FRAGMENT_INDEX: str = 'fragment_index'¶
The store uses the v0.6 fragment-index encoding for
vertex_fragmentsandlink_fragments(single uint8 blob per chunk; seezarr_vectors.encoding.fragments).
- zarr_vectors.constants.CAP_MULTISCALE_LINKS: str = 'multiscale_links'¶
Store uses the 0.4 multiscale links layout (
links/<delta>/,cross_chunk_links/<delta>/,link_attributes/<name>/<delta>/andcross_chunk_link_attributes/<name>/<delta>/) and may contain cross-pyramid-level edges (delta != 0).
- zarr_vectors.constants.CAP_PRESERVED_OBJECT_IDS: str = 'preserved_object_ids'¶
At least one resolution level was written with ID-preserving sparsification (
preserves_object_ids=Trueon the level metadata). Dropped objects appear as empty manifest slots and zeropresent_maskbytes;parent_levelcarries semantic weight.
- zarr_vectors.constants.CAP_SHARED_FRAGMENTS: str = 'shared_fragments'¶
At least one resolution level stores per-chunk fragments that may be referenced by multiple objects’ manifests (the v0.6 successor to
shared_vertex_groups; the sharing primitive is now a fragment rather than a contiguous-byte vertex group).
- zarr_vectors.constants.COARSEN_PER_OBJECT: str = 'per_object'¶
each surviving object’s vertices are aggregated into bin centroids (metavertices). Metavertices may be shared between objects; OIDs are preserved across levels.
- Type:
Per-object pyramid
- zarr_vectors.constants.DEFAULT_AXES_NAMES: tuple[str, ...] = ('x', 'y', 'z', 'w')¶
Default axis names used when
create_storeis called without an explicitaxeskwarg. Indexed bysid_ndim(1 →("x",), 2 →("x", "y"), …). Stops at 4 dims; higher-dim stores must pass axes explicitly.
- zarr_vectors.constants.DEFAULT_BIN_RATIO: tuple[int, ...] = (1, 1, 1)¶
Bin ratio at level 0 (no downsampling).
- zarr_vectors.constants.DEFAULT_BOUNDS_SIDE: float = 128.0¶
Default per-dimension extent for a freshly-warmed store. When
create_store(path)is called with noboundskwarg, the store is created withbounds = ([0,...,0], [128,...,128])for the resolvedsid_ndim. Out-of-bounds writes raise unless anout_of_bounds=policy is supplied by the caller.
- zarr_vectors.constants.DEFAULT_CROSS_LEVEL_DEPTH: int = 1¶
emit
±1cross-level link arrays at every adjacent level pair.0disables,-1means all available pyramid levels.- Type:
Default
cross_level_depth
- zarr_vectors.constants.DEFAULT_CROSS_LEVEL_STORAGE: str = 'explicit'¶
materialize both
+N(at the finer level) and-N(at the coarser level).- Type:
Default
cross_level_storage
- zarr_vectors.constants.DEFAULT_OOB_POLICY: str = 'raise'¶
Default
out_of_boundspolicy applied by the top-level write functions when the caller does not specify one. Values:"raise"(reject the write),"ignore"(silently drop out-of-bounds vertices),"expand"(grow storeboundsto include the new data).
- zarr_vectors.constants.DEFAULT_REDUCTION_FACTOR: int = 8¶
only emit a new resolution level when vertex count drops by 8×.
- Type:
Default
- zarr_vectors.constants.FORMAT_VERSION: str = '0.7.0'¶
Current ZV specification version.
0.7.0: per-level
chunk_shape.RootMetadata.chunk_shaperemains the level-0 default;LevelMetadatagains an optionalchunk_shapefield that, when set, overrides root for that level. Required invariant: per-levelchunk_shapemust be a positive integer multiple of the rootchunk_shapealong every axis (nested chunk grids). This lets coarser pyramid levels use larger chunks the way OME-Zarr image pyramids grow physical chunk extent via voxel-size scaling. Cross-level link arrays keep the single-chunk-key convention; the differing level’s chunk coord is computed by integer division using the per-level chunk_shape ratio. Hard break: 0.6.x stores are not readable; rewrite from source.0.6.0: fragment-index schema. Replaces
vertex_group_offsetswithvertex_fragmentsand splits the v0.5 inline-header link blob into a flatlinks/0/<chunk>payload plus a siblinglink_fragments/<chunk>group. The fragment-index byte layout expresses each per-group boundary as either a contiguous index range[start, count)or an explicit list of row indices, supporting vertex re-use across fragments.object_index/datanow uses a per-chunk manifest-block format with single / range / explicit modes; cross-level link arrays (cross_chunk_links,delta != 0) are unchanged. Hard break: 0.5.x stores are not readable; rewrite from source.0.5.0: NGFF-alignment cleanup + format simplification. The 0.5 series went through several on-disk simplifications without a version bump (consumers should pin to a specific point release):
vertex_counts/per-chunk sidecars removed; per-chunk vertex counts are derived fromvertex_group_offsetsand thevertices/<key>blob size.vertex_group_offsets/<key>is a plain(K,)int64 array of vertex byte offsets (the legacy(K, 2)paired layout with a link-offset column is gone).attributes/<name>/<key>_offsetssibling blobs removed. Attribute groups align 1:1 with vertex groups; per-group byte offsets are computed at read time.metanode_children/removed. Pyramid drill-down uses thelinks/<+1>/+cross_chunk_links/<+1>/arrays emitted inline during coarsening (mirrored as-1on the coarse side undercross_level_storage="explicit").cross_chunk_faces/removed. Cross-chunk face identity usescross_chunk_links/<delta>/withlink_width=3. Thecross_chunk_linksarray carries alink_widthmetadata field (default 2 for edges).object_index/pending/staging tree removed. Incremental writes go directly intoobject_index/; transactional backends (icechunk) make this cheap.
Earlier 0.5 changes (now baseline): renamed
format_versiontozv_version, moved axes tomultiscales[0].axes, dropped per-array dtype duplication.0.4.1: bare-integer resolution-level group names (
0/,1/).
- zarr_vectors.constants.LINK_FRAGMENTS: str = 'link_fragments'¶
Per-chunk fragment-index group describing how rows of
links/0/<chunk>group into fragments. Exists atdelta == 0only; cross-level link arrays keep their inline self-describing header.
- zarr_vectors.constants.PARAMETRIC_GROUP: str = 'parametric'¶
Name of the root-level parametric objects group.
- zarr_vectors.constants.RESOLUTION_PREFIX: str = ''¶
Empty under the 0.4.1 layout — resolution level groups are bare integer names (
0,1, …) to mirror OME-Zarr’s convention. Retained as a symbol so callers that build paths viaf"{RESOLUTION_PREFIX}{n}"keep working without import churn.
- zarr_vectors.constants.VERTEX_FRAGMENTS: str = 'vertex_fragments'¶
Per-chunk fragment-index group describing how rows of
vertices/<chunk>group into fragments. Seezarr_vectors.encoding.fragments.
Geometry type constant values¶
Constant |
Value |
Use |
|---|---|---|
|
|
Unconnected vertices |
|
|
Independent line segment pairs |
|
|
Ordered vertex paths |
|
|
Tractography paths with metadata |
|
|
Arbitrary vertex–edge graph |
|
|
Tree-structured morphology (SWC-compatible) |
|
|
Triangulated surface mesh |