diff --git a/Raidionics/Raidionics/src/gui/Diagnosis/DiagnosisInterfaceWidget.py b/Raidionics/Raidionics/src/gui/Diagnosis/DiagnosisInterfaceWidget.py index 300a4fc..2c08b39 100644 --- a/Raidionics/Raidionics/src/gui/Diagnosis/DiagnosisInterfaceWidget.py +++ b/Raidionics/Raidionics/src/gui/Diagnosis/DiagnosisInterfaceWidget.py @@ -166,6 +166,9 @@ def on_diagnosis_selection(self, index): self.diagnosis_model_parameters.destroy() json_model = self.find_json_model(selected_model_name=selected_model) + if not json_model: + return + self.diagnosis_model_parameters.create(json_model) if "briefdescription" in json_model: diff --git a/Raidionics/Raidionics/src/gui/Segmentation/ModelsExecutionWidget.py b/Raidionics/Raidionics/src/gui/Segmentation/ModelsExecutionWidget.py index 38723aa..1d34ade 100644 --- a/Raidionics/Raidionics/src/gui/Segmentation/ModelsExecutionWidget.py +++ b/Raidionics/Raidionics/src/gui/Segmentation/ModelsExecutionWidget.py @@ -46,8 +46,18 @@ def setup_execution_area(self): tmp_layout = qt.QGridLayout() self.advanced_use_gpu_label = qt.QLabel('Use GPU') self.advanced_use_gpu_checkbox = qt.QCheckBox() + self.advanced_use_gpu_checkbox.setEnabled(False) tmp_layout.addWidget(self.advanced_use_gpu_label, 0, 0) tmp_layout.addWidget(self.advanced_use_gpu_checkbox, 0, 1) + self.advanced_use_stripped_inputs_label = qt.QLabel('Stripped inputs') + self.advanced_use_stripped_inputs_checkbox = qt.QCheckBox() + tmp_layout.addWidget(self.advanced_use_stripped_inputs_label, 0, 2) + tmp_layout.addWidget(self.advanced_use_stripped_inputs_checkbox, 0, 3) + self.advanced_use_registered_inputs_label = qt.QLabel('Registered inputs') + self.advanced_use_registered_inputs_checkbox = qt.QCheckBox() + tmp_layout.addWidget(self.advanced_use_registered_inputs_label, 0, 4) + tmp_layout.addWidget(self.advanced_use_registered_inputs_checkbox, 0, 5) + self.advanced_predictions_type_label = qt.QLabel('Predictions') self.advanced_predictions_type_combobox = qt.QComboBox() self.advanced_predictions_type_combobox.addItems(['Probabilities', 'Binary']) @@ -103,6 +113,8 @@ def setup_interactive_results_area(self): def setup_connections(self): self.advanced_use_gpu_checkbox.connect("stateChanged(int)", self.on_use_gpu_change) + self.advanced_use_stripped_inputs_checkbox.connect("stateChanged(int)", self.on_use_stripped_inputs_change) + self.advanced_use_registered_inputs_checkbox.connect("stateChanged(int)", self.on_use_registered_inputs_change) self.advanced_resampling_combobox.connect("currentIndexChanged(QString)", self.on_sampling_strategy_change) self.advanced_predictions_type_combobox.connect("currentIndexChanged(QString)", self.on_predictions_type_change) @@ -132,6 +144,18 @@ def on_use_gpu_change(self, state): elif state == qt.Qt.Unchecked: SharedResources.getInstance().use_gpu = False + def on_use_stripped_inputs_change(self, state): + if state == qt.Qt.Checked: + SharedResources.getInstance().user_configuration['Runtime']['use_stripped_data'] = 'True' + elif state == qt.Qt.Unchecked: + SharedResources.getInstance().user_configuration['Runtime']['use_stripped_data'] = 'False' + + def on_use_registered_inputs_change(self, state): + if state == qt.Qt.Checked: + SharedResources.getInstance().user_configuration['Runtime']['use_registered_data'] = 'True' + elif state == qt.Qt.Unchecked: + SharedResources.getInstance().user_configuration['Runtime']['use_registered_data'] = 'False' + def on_sampling_strategy_change(self, order): if order == 'First': SharedResources.getInstance().user_configuration['Predictions']['reconstruction_order'] = 'resample_first' diff --git a/Raidionics/Raidionics/src/utils/backend_utilities.py b/Raidionics/Raidionics/src/utils/backend_utilities.py index 9b1ab0d..2f93571 100644 --- a/Raidionics/Raidionics/src/utils/backend_utilities.py +++ b/Raidionics/Raidionics/src/utils/backend_utilities.py @@ -33,11 +33,14 @@ def generate_backend_config(input_folder: str, parameters, logic_target_space: s rads_config.set('System', 'model_folder', '/home/ubuntu/resources/models') rads_config.set('System', 'pipeline_filename', '/home/ubuntu/resources/models/' + model_name + '/pipeline.json') rads_config.add_section('Runtime') - # @TODO. The backend disregards those parameters after the latest RADS lib update, has to be fixed rads_config.set('Runtime', 'reconstruction_method', SharedResources.getInstance().user_configuration['Predictions']['reconstruction_method']) rads_config.set('Runtime', 'reconstruction_order', SharedResources.getInstance().user_configuration['Predictions']['reconstruction_order']) + rads_config.set('Runtime', 'use_stripped_data', + SharedResources.getInstance().user_configuration['Runtime']['use_stripped_data']) + rads_config.set('Runtime', 'use_registered_data', + SharedResources.getInstance().user_configuration['Runtime']['use_registered_data']) # rads_config.add_section('Neuro') # if SoftwareConfigResources.getInstance().user_preferences.compute_cortical_structures: # rads_config.set('Neuro', 'cortical_features', 'MNI, Schaefer7, Schaefer17, Harvard-Oxford') diff --git a/Raidionics/Raidionics/src/utils/resources.py b/Raidionics/Raidionics/src/utils/resources.py index 5c3f02b..6715c91 100644 --- a/Raidionics/Raidionics/src/utils/resources.py +++ b/Raidionics/Raidionics/src/utils/resources.py @@ -80,6 +80,9 @@ def __set_runtime_parameters(self): self.user_configuration['Predictions']['non_overlapping'] = 'true' self.user_configuration['Predictions']['reconstruction_method'] = 'probabilities' self.user_configuration['Predictions']['reconstruction_order'] = 'resample_first' + self.user_configuration['Runtime'] = {} + self.user_configuration['Runtime']['use_stripped_data'] = 'False' + self.user_configuration['Runtime']['use_registered_data'] = 'False' self.user_configuration['Neuro'] = {} self.user_configuration['Neuro']['brain_segmentation_filename'] = '' self.user_configuration['Mediastinum'] = {} @@ -94,4 +97,3 @@ def __set_runtime_parameters(self): self.user_diagnosis_configuration['Neuro'] = {} self.user_diagnosis_configuration['Neuro']['tumor_segmentation_filename'] = '' self.user_diagnosis_configuration['Neuro']['brain_segmentation_filename'] = '' - self.user_diagnosis_configuration['Neuro']['tumor_type'] = ''