@@ -46,11 +46,11 @@ def decode_waterz(
4646 dust_merge_affinity : float = 0.0 ,
4747 dust_remove_size : int = 0 ,
4848 branch_merge : bool = False ,
49- branch_iou_threshold : float = 0.5 ,
50- branch_best_buddy : bool = True ,
51- branch_one_sided_threshold : float = 0.8 ,
52- branch_one_sided_min_size : int = 100 ,
53- branch_affinity_threshold : float = 0.0 ,
49+ iou_threshold : float = 0.5 ,
50+ best_buddy : bool = True ,
51+ one_sided_threshold : float = 0.8 ,
52+ one_sided_min_size : int = 100 ,
53+ affinity_threshold : float = 0.0 ,
5454 return_all_thresholds : bool = False ,
5555 ** kwargs : Any ,
5656) -> "np.ndarray | Dict[float, np.ndarray]" :
@@ -123,18 +123,16 @@ def decode_waterz(
123123 branch_merge: Enable branch merge postprocessing. Resolves false
124124 splits by analyzing segment continuity across z-slices using
125125 IOU overlap, best-buddy matching, and one-sided IOU.
126- Inspired by em_pipeline branch resolution. Default: False
127- branch_iou_threshold: Stage 1 threshold for full Jaccard IOU
128- merge between consecutive z-slices. Default: 0.5
129- branch_best_buddy: Enable Stage 2 mutual best-match merge.
130- Default: True
131- branch_one_sided_threshold: Stage 3 one-sided IOU threshold.
132- Merge if ``overlap / min(size0, size1)`` exceeds this.
133- Set to 0 to disable. Default: 0.8
134- branch_one_sided_min_size: Stage 3 minimum segment size in the
135- slice to be considered for one-sided merge. Default: 100
136- branch_affinity_threshold: Minimum mean z-boundary affinity for
137- a branch merge to be accepted. 0 to disable. Default: 0.0
126+ Default: False
127+ iou_threshold: Full Jaccard IOU threshold for branch merge.
128+ Default: 0.5
129+ best_buddy: Enable mutual best-match merge. Default: True
130+ one_sided_threshold: One-sided IOU threshold
131+ (``overlap / min(size0, size1)``). 0 to disable. Default: 0.8
132+ one_sided_min_size: Minimum segment size in slice for one-sided
133+ merge. Default: 100
134+ affinity_threshold: Minimum mean z-boundary affinity for a merge.
135+ 0 to disable. Default: 0.0
138136 return_all_thresholds: If True and multiple thresholds are given,
139137 return a dict mapping each threshold to its segmentation.
140138 Otherwise return only the last threshold's result. Default: False
@@ -302,11 +300,11 @@ def decode_waterz(
302300 seg = _branch_merge (
303301 seg ,
304302 affinities = affs ,
305- iou_threshold = branch_iou_threshold ,
306- best_buddy = branch_best_buddy ,
307- one_sided_threshold = branch_one_sided_threshold ,
308- one_sided_min_size = branch_one_sided_min_size ,
309- affinity_threshold = branch_affinity_threshold ,
303+ iou_threshold = iou_threshold ,
304+ best_buddy = best_buddy ,
305+ one_sided_threshold = one_sided_threshold ,
306+ one_sided_min_size = one_sided_min_size ,
307+ affinity_threshold = affinity_threshold ,
310308 channel_order = "zyx" , # already converted above
311309 )
312310 n_after = len (np .unique (seg )) - (1 if 0 in seg else 0 )
0 commit comments