From 8ff92eb3cdc5a27826065270f63ea9d29ab00341 Mon Sep 17 00:00:00 2001 From: Scott Staniewicz Date: Wed, 31 Jul 2024 19:39:53 -0400 Subject: [PATCH] Use `label` to count labels (#375) --- src/dolphin/timeseries.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dolphin/timeseries.py b/src/dolphin/timeseries.py index 336783ae..83dfc366 100644 --- a/src/dolphin/timeseries.py +++ b/src/dolphin/timeseries.py @@ -923,7 +923,7 @@ def intersect_conncomp(arr: np.ma.MaskedArray, axis: int) -> np.ndarray: # Make a mask of the largest conncomp: # Find the label with the most pixels using bincount - label_counts = np.bincount(conncomp_intersection.ravel()) + label_counts = np.bincount(label.ravel()) # (ignore the 0 label) largest_idx = np.argmax(label_counts[1:]) + 1 # Create a mask of pixels with this label