Skip to content

Commit

Permalink
current and normalised stack synced with Main Window
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeSullivan7 committed Mar 7, 2024
1 parent a0c5041 commit 806f8ed
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions mantidimaging/gui/windows/spectrum_viewer/presenter.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,18 @@ def __init__(self, view: 'SpectrumViewerWindowView', main_window: 'MainWindowVie
self.main_window = main_window
self.model = SpectrumViewerWindowModel(self)
self.export_mode = ExportMode.ROI_MODE
self.main_window.stack_changed.connect(self.handle_stack_changed)

def handle_stack_changed(self):
self.model.set_stack(self.main_window.get_stack(self.current_stack_uuid))
normalise_uuid = self.view.get_normalise_stack()
if normalise_uuid is not None:
try:
norm_stack: Optional['ImageStack'] = self.main_window.get_stack(normalise_uuid)
except RuntimeError:
norm_stack = None
self.model.set_normalise_stack(norm_stack)
self.redraw_all_rois()

def handle_sample_change(self, uuid: Optional['UUID']) -> None:
if uuid == self.current_stack_uuid:
Expand Down

0 comments on commit 806f8ed

Please sign in to comment.