Skip to content

Commit

Permalink
Remove pass through SpectrumViewerWindowPresenter.do_set_roi_alpha()
Browse files Browse the repository at this point in the history
  • Loading branch information
samtygier-stfc committed Oct 26, 2023
1 parent 1d08768 commit 35ad142
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
9 changes: 0 additions & 9 deletions mantidimaging/gui/windows/spectrum_viewer/presenter.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,6 @@ def redraw_all_rois(self) -> None:
self.model.set_roi(name, self.view.spectrum.get_roi(name))
self.view.set_spectrum(name, self.model.get_spectrum(name, self.spectrum_mode))

def do_set_roi_alpha(self, name: str, alpha: float) -> None:
"""
Set the alpha value of the ROI with the given name
:param name: The name of the ROI
:param alpha: The new alpha value (0-255)
"""
self.view.spectrum.set_roi_alpha(name, alpha)

def handle_button_enabled(self) -> None:
"""
Enable the export button if the current stack is not None and normalisation is valid
Expand Down
2 changes: 1 addition & 1 deletion mantidimaging/gui/windows/spectrum_viewer/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def set_roi_alpha(self, alpha: float, roi_name: str) -> None:
@param alpha: The alpha value
"""
self.presenter.do_set_roi_alpha(roi_name, alpha)
self.spectrum.set_roi_alpha(roi_name, alpha)
if alpha == 0:
self.spectrum.spectrum_data_dict[roi_name] = np.zeros(self.spectrum.spectrum_data_dict[roi_name].shape)
else:
Expand Down

0 comments on commit 35ad142

Please sign in to comment.