mantidimaging.gui.windows.spectrum_viewer.presenter module

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.

auto_find_flat_stack(new_dataset_id)[source]
current_norm_stack_uuid: 'UUID' | None = None
current_stack_uuid: 'UUID' | None = None
do_add_roi() None[source]

Add a new ROI to the spectrum

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=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

get_dataset_id_for_stack(stack_id: 'UUID' | None) 'UUID' | None[source]
get_default_table_state() list[source]

Get the default state of the table

get_roi_names() list[source]

Return a list of ROI names

@return: list of ROI names

handle_enable_normalised(enabled: bool) None[source]
handle_export_button_enabled() None[source]

Enable the export button if the current stack is not None

handle_export_csv() None[source]
handle_normalise_stack_change(normalise_uuid: 'UUID' | None) None[source]
handle_range_slide_moved(tof_range) None[source]
handle_roi_moved() None[source]

Handle changes to any ROI position and size.

handle_sample_change(uuid: 'UUID' | None) None[source]
model: SpectrumViewerWindowModel
redraw_all_rois() None[source]

Redraw all ROIs and spectrum plots

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

show_new_sample() None[source]

Show the new sample in the view and update the spectrum and image view accordingly. If swapping between samples, any additional ROIs will be removed leaving only the default ROI.

spectrum_mode: SpecType = 1
view: SpectrumViewerWindowView