neu_vol.ops.wk_mappings

Fetch a webknossos layer’s agglomerate views as lookup tables, and describe each view.

One supervoxel volume plus one table per view replaces one volume per view: a table is table[supervoxel] = agglomerate for every supervoxel id, a few MB, fetched in about half a minute, and the view is table[volume] — read on the fly through a descriptor (neu_vol/mapped.py) or converted once chosen. The tables are also data in their own right: which supervoxels a view merges is exactly what separates an agglomeration error from a supervoxel error.

Writes, into out (a local directory or an object-store prefix):

  • <view>.npy — the dense uint64 table, index = supervoxel id;

  • <view>.json — a descriptor over volume, when a supervoxel volume is given;

  • mappings.json — what was fetched, from which dataset, and per-view counts.

Resumable: a view whose table exists is skipped unless overwrite.

Attributes

Functions

fetch_mapping_tables(src, out, *[, volume, mappings, ...]) → dict

Fetch tables for mappings (default: every agglomerate view) of src.

Module Contents

neu_vol.ops.wk_mappings.fetch_mapping_tables(src: str, out: str, *, volume: str | None = None, mappings: Sequence[str] | None = None, overwrite: bool = False, max_id: int | None = None, threads: int = 4, progress=None) → dict

Fetch tables for mappings (default: every agglomerate view) of src.

src is wk://DATASET/LAYER. volume is the supervoxel volume the descriptors should read — normally a convert of the same src with no mapping. max_id overrides the layer’s recorded largestSegmentId as the highest supervoxel id. threads views are fetched at once. progress(name, seconds, n_agglomerates) is called after each view, in the calling thread.

neu_vol.ops.wk_mappings.INDEX = 'mappings.json'
neu_vol.ops.wk_mappings.logger