Skip to content

Commit

Permalink
Spectrum Viewer stacks update after Operations (#2113)
Browse files Browse the repository at this point in the history
  • Loading branch information
samtygier-stfc committed Mar 11, 2024
2 parents 1ab346e + 0155304 commit fc0535e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#2113: Spectrum Viewer stacks now update with Main Window after operation applied
16 changes: 16 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,22 @@ 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) -> None:
if self.current_stack_uuid:
self.model.set_stack(self.main_window.get_stack(self.current_stack_uuid))
else:
return
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.show_new_sample()
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 fc0535e

Please sign in to comment.