From d48f6c6a182970b276a5e36c02779946ece73fcc Mon Sep 17 00:00:00 2001 From: William Silversmith Date: Sun, 17 Nov 2024 02:15:15 -0500 Subject: [PATCH] fix: incorrect result for k=1 --- cc3d/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cc3d/__init__.py b/cc3d/__init__.py index 033cf92..ad47663 100644 --- a/cc3d/__init__.py +++ b/cc3d/__init__.py @@ -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