diff --git a/SlicerCART/src/SlicerCART.py b/SlicerCART/src/SlicerCART.py index ce2e016..03c97b7 100644 --- a/SlicerCART/src/SlicerCART.py +++ b/SlicerCART/src/SlicerCART.py @@ -522,7 +522,7 @@ def onSelectVolumesFolderButton(self): return self.Cases = sorted([os.path.split(i)[-1] for i in self.CasesPaths]) - + print(self.Cases) self.reset_ui() self.ui.pushButton_Interpolate.setEnabled(True) @@ -1779,31 +1779,30 @@ def set_ui_enabled_options(self): @enter_function def update_case_list_colors(self): - if self.outputFolder is None or self.CurrentFolder is None: - return - - segmentation_information_path = f'{self.currentOutputPath}{os.sep}{self.currentVolumeFilename}_SegmentationInformation.csv' - segmentation_information_df = None - if os.path.exists(segmentation_information_path): - segmentation_information_df = pd.read_csv(segmentation_information_path) + if self.outputFolder is None or self.CurrentFolder is None: + return - self.ui.SlicerDirectoryListView.clear() - for case in self.Cases: + self.ui.SlicerDirectoryListView.clear() + for case in self.Cases: case_id = case.split('.')[0] item = qt.QListWidgetItem(case_id) - - currentCaseSegmentationStatus = self.get_segmentation_status(case, segmentation_information_df) - if currentCaseSegmentationStatus == 0: - item.setForeground(qt.QColor(self.foreground)) - elif currentCaseSegmentationStatus == 1: - item.setForeground(qt.QColor('orange')) - elif currentCaseSegmentationStatus == 2: - item.setForeground(qt.QColor('green')) - + segmentation_information_path = f'{self.currentOutputPath}{os.sep}{case_id}_SegmentationInformation.csv' + print(segmentation_information_path) + segmentation_information_df = None + if os.path.exists(segmentation_information_path): + segmentation_information_df = pd.read_csv(segmentation_information_path) + currentCaseSegmentationStatus = self.get_segmentation_status(case, segmentation_information_df) + if currentCaseSegmentationStatus == 0: + item.setForeground(qt.QColor(self.foreground)) + elif currentCaseSegmentationStatus == 1: + item.setForeground(qt.QColor('orange')) + elif currentCaseSegmentationStatus == 2: + item.setForeground(qt.QColor('green')) + self.ui.SlicerDirectoryListView.addItem(item) - else: - return - + + + def get_segmentation_status(self, case, segmentation_information_df): self.annotator_name = self.ui.Annotator_name.text