Skip to content

Commit 3091bc4

Browse files
Document the dense-label requirement of the distributed pipeline
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 86a2548 commit 3091bc4

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

MIGRATION_GUIDE.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,11 @@ per-block subgraphs/features to zarr/N5/HDF5) is intentionally left to the
500500
caller, since I/O and block scheduling belong in Python.
501501

502502
The primitives assume **globally consistent labels** (a segment has the same id
503-
in every block — as after a stitched distributed watershed). A block owns the
503+
in every block — as after a stitched distributed watershed). Labels must also
504+
be reasonably **dense**: the global graph allocates memory proportional to the
505+
largest node id (`from_unique_edges(number_of_nodes, ...)` builds a dense CSR
506+
over ids `0 .. number_of_nodes - 1`), so sparse or very large globally unique
507+
id ranges need a relabeling pass before building the graph. A block owns the
504508
pixel-pairs whose reference pixel lies in its inner (non-halo) box, so the
505509
caller reads each block with a halo (≥1 on the forward faces for the region
506510
graph / an edge map; ≥ `max |offset|` per side for affinities) and passes the

src/bioimage_cpp/graph/distributed.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@
2121
2222
2. **Merge the graph**: :func:`merge_edges` unions the per-block edges into the
2323
whole-volume edge set; build the global graph with
24-
:meth:`bioimage_cpp.graph.UndirectedGraph.from_unique_edges`.
24+
:meth:`bioimage_cpp.graph.UndirectedGraph.from_unique_edges`. Labels must be
25+
globally consistent *and* reasonably dense: the graph allocates memory
26+
proportional to the largest node id, so sparse or very large globally unique
27+
id ranges need a relabeling pass first.
2528
2629
3. **Merge the features**: fold each block's partial statistics onto the global
2730
edges with :func:`merge_block_edge_stats` (starting from

0 commit comments

Comments
 (0)