Algorithms

zarr_vectors_tools.algorithms measures and queries a store in place. Each function reads the chunks it needs from one level and returns arrays, dicts or pandas tables. Bundle summaries also have a command, zvtools bundles STORE.

Function

Geometry

Computes

bfs_distances

graph, skeleton

hop count and parent from one vertex

shortest_path

graph, skeleton

Dijkstra or A* path and cost

compute_connected_components

graph, skeleton

component label per vertex

compute_k_core

graph, skeleton

coreness per vertex

compute_label_propagation

graph, skeleton

community per vertex

compute_louvain

graph, skeleton

community per vertex, modularity

compute_mesh_summary

mesh

area, volume, Euler characteristic

compute_vertex_normals

mesh

unit normal per vertex

compute_mean_curvature

mesh

mean curvature per vertex

closest_point

mesh

nearest point on the surface

cast_ray

mesh

first surface hit along a ray

select_streamlines

streamlines

ids of streamlines through, or ending in, a region

bundle_summary

streamlines with groups

per group: count, length, tortuosity, endpoint centroids

read_bundle_summary

streamlines with groups

the stored bundle_summary rows

compute_skeleton_metrics

skeleton

per object: cable length, counts, Strahler order, extent

SegmentLink

stores with segment ids

the same segment’s object in each store

read_hemisphere

cortical surface

one hemisphere in source vertex order

parcel_summary

cortical surface

per parcel: vertex count, area, map statistics

parcel_at

cortical surface

the parcel nearest each point

Every function takes the store path first (SegmentLink takes several) and level=0 as a keyword. compute_connected_components, compute_vertex_normals and compute_mean_curvature store their result as a vertex attribute with write_back=True. compute_skeleton_metrics and bundle_summary store theirs by default. A function writes to the level it reads, and a rerun replaces the attribute; bundle_summary reads level 0 and writes to every level.

Every function follows objects across chunk boundaries: an edge or triangle whose ends lie in different chunks counts once. Results do not depend on the chunk shape.