From 881e843f712d71cf105a8b1e6c0bd324147a0c6c Mon Sep 17 00:00:00 2001 From: nrepina Date: Wed, 21 Aug 2024 20:54:02 +0200 Subject: [PATCH] Bug fix in select largest component function. Initialize volume and label values to 0, not None. --- src/scmultiplex/meshing/LabelFusionFunctions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scmultiplex/meshing/LabelFusionFunctions.py b/src/scmultiplex/meshing/LabelFusionFunctions.py index 0b5bee0..b6caf67 100644 --- a/src/scmultiplex/meshing/LabelFusionFunctions.py +++ b/src/scmultiplex/meshing/LabelFusionFunctions.py @@ -158,8 +158,8 @@ def select_largest_component(label_image): roi_count = len(rois) if roi_count > 1: - label_with_largest_volume = None - largest_volume = None + label_with_largest_volume = 0 + largest_volume = 0 for r in rois: rlabel = r.label rvolume = r.area