mantidimaging.gui.windows.spectrum_viewer.presenter module#
- class mantidimaging.gui.windows.spectrum_viewer.presenter.ExportMode(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
Bases:
Enum
- IMAGE_MODE = 1#
- ROI_MODE = 0#
- class mantidimaging.gui.windows.spectrum_viewer.presenter.SpectrumViewerWindowPresenter(view: SpectrumViewerWindowView, main_window: MainWindowView)[source]#
Bases:
BasePresenter
The presenter for the spectrum viewer window.
This presenter is responsible for handling user interaction with the view and updating the model and view accordingly to look after the state of the window.
- change_roi_colour(roi_name: str, new_colour: tuple[int, int, int]) None [source]#
Change the colour of a given ROI in both the spectrum widget and the table.
@param roi_name: Name of the ROI to change color. @param new_colour: The new color for the ROI.
- convert_spinbox_roi_to_SensibleROI(spinboxes: dict[str, QSpinBox]) SensibleROI [source]#
- do_add_roi_to_table(roi_name: str) None [source]#
Add a given ROI to the table by ROI name
@param roi_name: Name of the ROI to add
- do_remove_roi(roi_name: str | None = None) None [source]#
Remove a given ROI from the table by ROI name or all ROIs from the table if no name is passed as an argument @param roi_name: Name of the ROI to remove
- export_mode: ExportMode#
- handle_button_enabled() None [source]#
Enable the export button if the current stack is not None and normalisation is valid
- handle_roi_clicked(roi: SpectrumROI) None [source]#
- handle_roi_moved(force_new_spectrums: bool = False) None [source]#
Handle changes to any ROI position and size.
- handle_sample_change(uuid: UUID | None) None [source]#
Called when the stack has been changed in the stack selector.
- handle_stack_modified() None [source]#
Called when an image stack is modified somewhere else in MI, for example in the operations window
- model: SpectrumViewerWindowModel#
- rename_roi(old_name: str, new_name: str) None [source]#
Rename a given ROI from the table by ROI name
@param old_name: Name of the ROI to rename @param new_name: New name of the ROI
- set_shuttercount_error(enabled: bool = False) None [source]#
Set ShutterCount error message when a valid normalisation stack has been selected and shuttercount correction has been toggled on and redraw all ROIs to ensure the spectrum is updated when ShutterCount correction is toggled between enabled and disabled states.