mantidimaging.gui.windows.spectrum_viewer.view module#

class mantidimaging.gui.windows.spectrum_viewer.view.ROIPropertiesTableWidget(parent=None)[source]#

Bases: BaseWidget

as_roi() SensibleROI[source]#
enable_widgets(enable: bool) None[source]#
group_box: QGroupBox#
label_height: QLabel#
label_width: QLabel#
roi_changed#

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

set_roi_limits(shape: tuple[int, ...]) None[source]#
set_roi_name(name: str) None[source]#
set_roi_values(roi: SensibleROI) None[source]#
spin_bottom: QSpinBox#
spin_left: QSpinBox#
spin_right: QSpinBox#
spin_top: QSpinBox#
class mantidimaging.gui.windows.spectrum_viewer.view.ROITableWidget(parent=None)[source]#

Bases: RemovableRowTableView

A class to represent the ROI table widget in the spectrum viewer window.

ElementType = str | tuple[int, int, int] | bool#
RowType#

alias of list[str | tuple[int, int, int] | bool]

add_row(name: str, colour: tuple[int, int, int, int], roi_names: list[str]) None[source]#

Add a new row to the ROI table

clear_table() None[source]#

Clears the ROI table in the spectrum viewer.

property current_roi_name: str#
find_row_for_roi(roi_name: str) int | None[source]#

Returns row index for ROI name, or None if not found.

get_roi_name_by_row(row: int) str[source]#

Retrieve the name an ROI by its row index.

get_roi_names() list[str][source]#
get_roi_visibility_by_row(row: int) bool[source]#

Retrieve the visibility status of an ROI by its row index.

name_changed#

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

on_row_change(item: QModelIndex, _: Any) None[source]#
remove_row(row: int) None[source]#

Remove a row from the ROI table

row_count() int[source]#

Returns the number of rows in the ROI table model.

select_roi(roi_name: str) None[source]#
selected_row: int#
selection_changed#

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

update_roi_color(roi_name: str, new_color: tuple[int, int, int, int]) None[source]#

Finds ROI by name in table and updates it’s colour (R, G, B) format.

visibility_changed#

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

class mantidimaging.gui.windows.spectrum_viewer.view.SpectrumViewerWindowView(main_window: MainWindowView)[source]#

Bases: BaseMainWindowView

add_roi_table_row(name: str, colour: tuple[int, int, int, int]) None[source]#

Add a new row to the ROI table

@param name: The name of the ROI @param colour: The colour of the ROI

auto_range_image() None[source]#
property bin_size: int#
bin_size_spinBox: QSpinBox#
property bin_step: int#
bin_step_spinBox: QSpinBox#
cleanup() None[source]#

Runs when the window is closed.

clear() None[source]#
disable_roi_properties() None[source]#
display_normalise_error() None[source]#
display_shuttercount_error() None[source]#
experimentSetupFormWidget: ExperimentSetupFormWidget#
experimentSetupGroupBox: QGroupBox#
exportButton: QPushButton#
exportLayout: QVBoxLayout#
exportTabs: QTabWidget#
fittingLayout: QVBoxLayout#
get_csv_filename() Path | None[source]#
get_normalise_stack() UUID | None[source]#
get_rits_export_directory() Path | None[source]#

Get the path to save the RITS file too

get_rits_export_filename() Path | None[source]#

Get the path to save the RITS file too

handle_change_tab(tab_index: int)[source]#
handle_shuttercount_change() None[source]#
handle_table_click(index: QModelIndex) None[source]#
imageLayout: QVBoxLayout#
property image_output_mode: str#
image_output_mode_combobox: QComboBox#
normalisation_enabled() bool[source]#
normaliseCheckBox: QCheckBox#
normaliseErrorIcon: QLabel#
normaliseStackSelector: DatasetSelectorWidgetView#
normalise_ShutterCount_CheckBox: QCheckBox#
normalise_error_issue: str = ''#
on_visibility_change() None[source]#

When the visibility of an ROI is changed, update the visibility of the ROI in the spectrum widget

remove_roi() None[source]#

Clear the selected ROI in the table view

roi_properties_widget: ROIPropertiesTableWidget#
sampleStackSelector: DatasetSelectorWidgetView#
set_binning_visibility() None[source]#
set_image(image_data: ndarray, autoLevels: bool = True) None[source]#
set_new_roi() None[source]#

Set a new ROI on the image

set_normalise_error(norm_issue: str) None[source]#
set_roi_properties() None[source]#
set_roi_visibility_flags(roi_name: str, visible: bool) None[source]#

Set the visibility for the selected ROI and update the spectrum to reflect the change. A check is made on the spectrum to see if it exists as it may not have been created yet. @param visible: Whether the ROI is visible.

set_shuttercount_error(shuttercount_issue: str) None[source]#
set_spectrum(name: str, spectrum_data: ndarray) None[source]#

Try to set the spectrum data for a given ROI assuming the roi may not exist in the spectrum widget yet depending on when method is called

set_spectum_roi_color(roi_name: str) None[source]#
setup_roi_properties_spinboxes() None[source]#
show(self)[source]#
show_visible_spectrums() None[source]#
shuttercountErrorIcon: QLabel#
shuttercount_error_issue: str = ''#
shuttercount_norm_enabled() bool[source]#
spectrum_widget: SpectrumWidget#
table_view: ROITableWidget#
property tof_units_mode: str#
property transmission_error_mode: str#
transmission_error_mode_combobox: QComboBox#
try_to_select_relevant_normalise_stack(name: str) None[source]#
update_roi_dropdown() None[source]#

Updates the ROI dropdown menu with the available ROIs.