diff --git a/mantidimaging/gui/windows/spectrum_viewer/presenter.py b/mantidimaging/gui/windows/spectrum_viewer/presenter.py index 86dae384737..0dbfcfdf2b9 100644 --- a/mantidimaging/gui/windows/spectrum_viewer/presenter.py +++ b/mantidimaging/gui/windows/spectrum_viewer/presenter.py @@ -202,7 +202,6 @@ def handle_roi_moved(self, force_new_spectrums: bool = False) -> None: """ for name in self.view.spectrum_widget.roi_dict: current_roi = self.view.spectrum_widget.get_roi(name) - self.view.spectrum_widget.set_roi(name, current_roi) if force_new_spectrums: spectrum = self.model.get_spectrum( current_roi, @@ -429,7 +428,6 @@ def change_selected_menu_option(self, opt: str) -> None: def do_adjust_roi(self) -> None: new_roi = self.convert_spinbox_roi_to_SensibleROI(self.view.roiPropertiesSpinBoxes) - self.view.spectrum_widget.set_roi(self.view.current_roi_name, new_roi) self.view.spectrum_widget.adjust_roi(new_roi, self.view.current_roi_name) def handle_storing_current_roi_name_on_tab_change(self) -> None: diff --git a/mantidimaging/gui/windows/spectrum_viewer/spectrum_widget.py b/mantidimaging/gui/windows/spectrum_viewer/spectrum_widget.py index 833c91dedd9..4e4c93bb30c 100644 --- a/mantidimaging/gui/windows/spectrum_viewer/spectrum_widget.py +++ b/mantidimaging/gui/windows/spectrum_viewer/spectrum_widget.py @@ -244,16 +244,6 @@ def get_roi(self, roi_name: str) -> SensibleROI: else: raise KeyError(f"ROI with name {roi_name} does not exist in self.roi_dict or and is not 'all'") - def set_roi(self, roi_name: str, new_roi: SensibleROI) -> None: - if roi_name not in self.roi_dict: - raise KeyError(f"ROI '{roi_name}' does not exist.") - roi = self.roi_dict[roi_name] - - roi.blockSignals(True) - roi.setPos((new_roi.left, new_roi.top)) - roi.setSize((new_roi.width, new_roi.height)) - roi.blockSignals(False) - def remove_roi(self, roi_name: str) -> None: """ Remove a given ROI by name unless it is 'roi' or 'all'. diff --git a/mantidimaging/gui/windows/spectrum_viewer/test/spectrum_test.py b/mantidimaging/gui/windows/spectrum_viewer/test/spectrum_test.py index 1fa4354f6c3..6c2f3806c93 100644 --- a/mantidimaging/gui/windows/spectrum_viewer/test/spectrum_test.py +++ b/mantidimaging/gui/windows/spectrum_viewer/test/spectrum_test.py @@ -152,14 +152,6 @@ def test_WHEN_roi_removed_THEN_roi_name_removed_from_list_of_roi_names(self): self.spectrum_widget.remove_roi("new_roi") self.assertListEqual(list(self.spectrum_widget.roi_dict.keys()), ["all", "roi"]) - def test_set_roi_updates_position_and_size(self): - self.spectrum_widget.roi_dict["test_roi"] = SpectrumROI("test_roi", SensibleROI(10, 20, 30, 40)) - new_roi = SensibleROI(50, 60, 120, 140) - self.spectrum_widget.set_roi("test_roi", new_roi) - roi = self.spectrum_widget.roi_dict["test_roi"] - self.assertEqual(roi.pos(), Point(50, 60)) - self.assertEqual(roi.size(), Point(70, 80)) - def test_WHEN_remove_roi_called_with_default_roi_THEN_raise_runtime_error(self): self.spectrum_widget.roi_dict = {"all": mock.Mock(), "roi": mock.Mock()} with self.assertRaises(RuntimeError):