Skip to content

Commit

Permalink
made suggeted chnages to the presenter.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ashmeigh committed Dec 9, 2024
1 parent 04ec340 commit 8fa0471
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions mantidimaging/gui/windows/spectrum_viewer/presenter.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,19 +220,20 @@ def redraw_spectrum(self, name: str) -> None:
"""
Redraw the spectrum with the given name
"""
for roi_name, roi in self.view.spectrum_widget.roi_dict.items():
roi = self.view.spectrum_widget.get_roi(roi_name)
self.view.set_spectrum(
name,
self.model.get_spectrum(roi,
self.spectrum_mode,
normalise_with_shuttercount=self.view.shuttercount_norm_enabled()))
roi = self.view.spectrum_widget.get_roi(name)
self.view.set_spectrum(
name,
self.model.get_spectrum(roi,
self.spectrum_mode,
normalise_with_shuttercount=self.view.shuttercount_norm_enabled()))

def redraw_all_rois(self) -> None:
"""
Redraw all ROIs and spectrum plots
"""
for roi_name in self.view.spectrum_widget.roi_dict:
for roi_name, roi_widget in self.view.spectrum_widget.roi_dict.items():
if not roi_widget.isVisible():
continue
widget_roi = self.view.spectrum_widget.get_roi(roi_name)
spectrum = self.model.get_spectrum(widget_roi, self.spectrum_mode, self.view.shuttercount_norm_enabled())
self.view.set_spectrum(roi_name, spectrum)
Expand Down

0 comments on commit 8fa0471

Please sign in to comment.