From 9da027bdce60886b7b5b608517cbdc6d3201c968 Mon Sep 17 00:00:00 2001 From: delphinepilon Date: Thu, 8 Aug 2024 14:57:40 -0400 Subject: [PATCH] fix bug when label list is empty and want to add new label --- SlicerCART/src/SlicerCART.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SlicerCART/src/SlicerCART.py b/SlicerCART/src/SlicerCART.py index 2d7c111..e0dd7db 100644 --- a/SlicerCART/src/SlicerCART.py +++ b/SlicerCART/src/SlicerCART.py @@ -1514,7 +1514,7 @@ def push_save(self): if label_found == False: # append - new_label = copy.deepcopy(self.label_config_yaml['labels'][0]) + new_label = {'color_b': 10, 'color_g': 10, 'color_r': 255, 'lower_bound_HU': 30, 'name': 'ICH', 'upper_bound_HU': 90, 'value': 1} new_label['name'] = self.name_line_edit.text new_label['value'] = len(self.label_config_yaml['labels']) + 1 new_label['color_r'] = int(self.color_r_line_edit.text)