Skip to content

Commit 4146715

Browse files
perf(connected_components_stack): major speedup
1 parent 4f2a35f commit 4146715

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cc3d/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ def connected_components_stack(
410410
return_N=True, out_dtype=np.uint64,
411411
binary_image=bool(binary_image),
412412
)
413-
cc_labels[cc_labels != 0] += offset
413+
np.add(cc_labels, offset, out=cc_labels, where=(cc_labels != 0))
414414
offset += N
415415
binary = crackle.compress(cc_labels)
416416

0 commit comments

Comments
 (0)