From 2efe878a28dcfa32aabcab357d464857b4bb85fd Mon Sep 17 00:00:00 2001 From: Stefan Hahmann Date: Mon, 11 Dec 2023 15:28:51 +0100 Subject: [PATCH] Convert max label to integer before using it as parameter for numpy.zeros() function --- napari_clusters_plotter/_utilities.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/napari_clusters_plotter/_utilities.py b/napari_clusters_plotter/_utilities.py index b4eb45ed..c0c38e7d 100644 --- a/napari_clusters_plotter/_utilities.py +++ b/napari_clusters_plotter/_utilities.py @@ -300,7 +300,7 @@ def generate_cluster_image(label_image, label_list, predictionlist): # label_list can be removed from method. predictionlist_new = np.array(predictionlist) + 1 - plist = np.zeros(np.max(label_image) + 1, dtype=np.uint32) + plist = np.zeros(int(np.max(label_image)) + 1, dtype=np.uint32) plist[label_list] = predictionlist_new predictionlist_new = plist