mantidimaging.gui.windows.spectrum_viewer.presenter module#

class mantidimaging.gui.windows.spectrum_viewer.presenter.ExportMode(value)[source]#

Bases: Enum

An enumeration.

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.

add_rits_roi() None[source]#
auto_find_flat_stack(new_dataset_id)[source]#
change_roi_colour(roi_name: str, new_colour: tuple) 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.

change_selected_menu_option(opt)[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: 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#
get_dataset_id_for_stack(stack_id: UUID | None) UUID | None[source]#
get_roi_names() list[source]#

Return a list of ROI names

@return: list of ROI names

handle_button_enabled() None[source]#

Enable the export button if the current stack is not None and normalisation is valid

handle_enable_normalised(enabled: bool) None[source]#
handle_export_csv() None[source]#
handle_export_tab_change(index: int) None[source]#
handle_flight_path_change() None[source]#
handle_normalise_stack_change(normalise_uuid: UUID | None) None[source]#
handle_range_slide_moved(tof_range) None[source]#
handle_rits_export() None[source]#

Handle the export of the current spectrum to a RITS file format

handle_roi_clicked(roi) 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]#
handle_stack_changed() None[source]#
handle_time_delay_change() None[source]#
handle_tof_unit_change() None[source]#
handle_tof_unit_change_via_menu() None[source]#
model: SpectrumViewerWindowModel#
redraw_all_rois() None[source]#

Redraw all ROIs and spectrum plots

redraw_spectrum(name: str) None[source]#

Redraw the spectrum with the given name

refresh_spectrum_plot() None[source]#
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

reset_units_menu()[source]#
show_new_sample() None[source]#

Show the new sample in the view and update the spectrum and image view accordingly. Resets the ROIs.

spectrum_mode: SpecType = 1#
view: SpectrumViewerWindowView#