mantidimaging.gui.widgets.spectrum_widgets.fitting_display_widget module#

class mantidimaging.gui.widgets.spectrum_widgets.fitting_display_widget.FittingDisplayWidget(parent: QWidget | None = None)[source]#

Bases: QWidget

Widget for displaying fitting-related spectrum plot using the reusable SpectrumPlotWidget.

clear() → None[source]#

Clear the fitting display widget data and reset to default state.

get_selected_fit_region() → FittingRegion[source]#
static is_data_in_region(x_data: ndarray, y_data: ndarray, roi: FittingRegion)[source]#
is_initial_fit_visible() → bool[source]#
set_default_region_if_needed(x_data: ndarray, y_data: ndarray) → None[source]#

Position the ROI centrally over the plotted data, if valid data and not in existing region We define valid data as a spectrum which is non-zero in length and does not consist of nans or zeros We check for lengths <= 1 to prevent the fitting region being shown for single-image ImageStacks, e.g. Flats

set_plot_mode(mode: str) → None[source]#
show_fit_line(x_data: ndarray, y_data: ndarray, *, color: tuple[int, int, int], label: str, initial: bool) → None[source]#

Plot a single fit line (initial or fitted) on the spectrum plot, removing any previous fit line.

Args:

x_data: The x-axis data for the fit line. y_data: The y-axis data for the fit line. color: The RGB color tuple for the line. label: The legend label for the line. initial: True if this is the initial fit, False if fitted curve.

show_roi_on_thumbnail_from_widget(roi: SensibleROI, color: tuple[int, int, int]) → None[source]#

Copy ROI size and color from the main image window ROI to the thumbnail overlay.

unit_changed#

Emitted when the user selects a different unit for the spectrum plot.

update_image(image: ndarray | None) → None[source]#
update_plot(x_data: ndarray, y_data: ndarray, label: str = 'ROI') → None[source]#