File tree Expand file tree Collapse file tree
connectomics/decoding/decoders Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -269,15 +269,9 @@ def decode_waterz(
269269 else :
270270 seg = waterz_result
271271
272- # Zero out voxels where mean xy affinity is below threshold,
273- # creating gaps at weak boundaries to separate segments.
272+ # Strip weak-boundary voxels so dust merge sees true core sizes.
274273 if border_threshold > 0 :
275- xy_mean = affs [1 :3 ].astype (np .float32 , copy = False ).mean (axis = 0 )
276- if is_uint8 :
277- xy_mean /= 255.0
278- border_mask = xy_mean < border_threshold
279- n_removed = int (border_mask .sum ())
280- seg [border_mask ] = 0
274+ n_removed = waterz .strip_border (seg , affs , threshold = border_threshold , channels = "xy" )
281275 logger .info ("border_threshold=%s: zeroed %d voxels" , border_threshold , n_removed )
282276
283277 # Size+affinity dust merge reusing the agglomeration's region graph
You can’t perform that action at this time.
0 commit comments