Skip to content

Commit

Permalink
fix: incorrect result for k=1
Browse files Browse the repository at this point in the history
  • Loading branch information
william-silversmith committed Nov 17, 2024
1 parent b7dc75d commit d48f6c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cc3d/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def largest_k(
cts = statistics(cc_labels, no_slice_conversion=True)["voxel_counts"]

if k == 1:
cc_out = (cc_labels == np.argmax(cts))
cc_out = (cc_labels == (np.argmax(cts[1:]) + 1))
if return_N:
return cc_out, 1
return cc_out
Expand Down

0 comments on commit d48f6c6

Please sign in to comment.