Skip to main content
zarr-vectors

zarr-vectors-tools

File format workflows, algorithms, and multiresolution for Zarr Vectors.

zarr-vectors-tools is an extension of zarr-vectors-py. It is not a standalone library, and neither this README nor its documentation restates that package's.

zarr-vectors-py owns Zarr Vectors — the specification and the Python API over it: store layout, chunk and bin geometry, fragments, links, the object model, resolution-level metadata, validation, and the two supported surfaces zarr_vectors.api and zarr_vectors.building. Anything about the format or the core API is documented there and only there.

This package adds the layers built on top of it: format-conversion workflows wrapping third-party readers and writers, streaming graph and mesh algorithms, the rich multiresolution coarsening layer, and the zvtools CLI.

Zarr Vectors was originally specified by Forrest Collman, Allen Institute for Brain Sciences.

Documentation (this package) zarr-vectors-tools docs
Parent package zarr-vectors-py · docs
Specification Zarr Vectors specification
Core API reference zarr_vectors.api / zarr_vectors.building
Upstream specification AllenInstitute/zarr_vectors

Install

pip install zarr-vectors-tools

Python ≥ 3.11. Every file format is gated behind an extra, so a base install stays slim:

pip install "zarr-vectors-tools[trk]"           # nibabel (TRK)
pip install "zarr-vectors-tools[streamlines]"   # nibabel + trx-python
pip install "zarr-vectors-tools[all]"           # everything except gpu

Extras: las, ply, trk, trx, streamlines, graph, points-enrichment, mesh, precomputed, parallel, gpu, all, dev.

Quick start

From the terminal:

zvtools convert cells.csv cells.zarrvectors --chunk-shape 100,100,100
zvtools pyramid cells.zarrvectors --coarsen 8,8 --sparsity 2,2
zvtools convert cells.zarrvectors cells.ply --level 1   # and back out again
zvtools merge cells.zarrvectors more_cells.csv       # append, don't replace
zvtools split cells.zarrvectors parts/ --by groups
zvtools info cells.zarrvectors
zvtools validate cells.zarrvectors --level 3

From Python — note that convert.ingest and convert.export have no re-exports, so import from the concrete module:

from zarr_vectors_tools.convert.ingest.csv_points import ingest_csv
from zarr_vectors_tools.multiresolution.coarsen import build_pyramid
from zarr_vectors_tools.algorithms import compute_connected_components

ingest_csv("cells.csv", "cells.zarrvectors", chunk_shape=(100.0, 100.0, 100.0))
build_pyramid("cells.zarrvectors", factors=[(8.0, 2.0), (8.0, 2.0)])

What's in it

Subpackage Purpose
convert.ingest CSV/XYZ, LAS/LAZ, PLY, line CSV, TCK, TRK, TRX, SWC, precomputed skeletons, OBJ, STL, edge-list CSV, GraphML, GIFTI, FreeSurfer
convert.export CSV, PLY, TRK, TRX, SWC, OBJ, h5ad
compose merge a file or another store into an existing one; split a store by group, label or merged source
multiresolution pyramid building: skeleton/polyline/point/mesh/graph coarsening, five object-selection strategies, cross-level links
algorithms streaming graph search, connected components, clustering; mesh summary, attributes, spatial queries
headers format-specific metadata preservation
cli the zvtools command line

Coarsening and sparsity are two orthogonal axes — coarsening reduces vertices within each object, sparsity drops whole objects while preserving the IDs of survivors. See Coarsening versus sparsity.

Development

git clone https://github.com/AllenInstitute/zarr-vectors-tools
cd zarr-vectors-tools
pip install -e ".[all,dev]"
pytest

Build the docs locally:

pip install -r docs/requirements-docs.txt
python -m sphinx -b html docs docs/_build/html

License

BSD-3-Clause.

Metadata

Release files for zarr-vectors-tools 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for zarr-vectors-tools 0.2.0
File Size Uploaded
zarr_vectors_tools-0.2.0.tar.gz 4.3 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for zarr-vectors-tools 0.2.0
File Interpreter ABI Platform
zarr_vectors_tools-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 4.8 MB

Release files / zarr_vectors_tools-0.2.0.tar.gz

Download URL zarr_vectors_tools-0.2.0.tar.gz
Size 4.3 MB
Tags Source
SHA-256 checksum
How to use checksums
94de3b195c9b50b0728eb7537b33be3875262f57419c892c36610faa444dd888
BLAKE2b-256 checksum
How to use checksums
bc8f1cd38139bf300c52fab4525210ed76120e41d54ce18094415465445b2f20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.9

Release files / zarr_vectors_tools-0.2.0-py3-none-any.whl

Download URL zarr_vectors_tools-0.2.0-py3-none-any.whl
Size 538.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
acc095f90842e6b9fc2d3753a751f2da0fb98a928048d78e444e0e26edceb838
BLAKE2b-256 checksum
How to use checksums
78319c878e11b971b310032b5cca5c319bc8374b616c99146bb948826d199ffb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.9

Release history Release notifications | RSS feed

0.3.0

2 release files

This release

0.2.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page