mantidimaging.gui.windows.spectrum_viewer.fitting_form module#

class mantidimaging.gui.windows.spectrum_viewer.fitting_form.FittingFormWidgetPresenter(view: FittingFormWidgetView)[source]#

Bases: object

Presenter for the fitting tab

Handles the behaviour of the fitting tab

property fitting_spectrum: tuple[ndarray, ndarray]#
get_current_roi() SensibleROI[source]#
get_init_params_from_roi() None[source]#
handle_activated() None[source]#
handle_roi_selection_changes() None[source]#
on_initial_params_edited() None[source]#

Handles updates when the initial fitting parameters are edited.

If the initial fit is visible, updates the plot with the new initial fit. Otherwise, re-runs the fit with the updated parameters, updates the fitted parameter values, and displays the new fit result.

run_region_fit() None[source]#

Run a fit on the currently selected ROI and update the GUI/export table.

set_binning() None[source]#
set_default_fitting_region() None[source]#
set_spectrum() None[source]#
setup_fitting_model() None[source]#
show_fit(params: list[float]) None[source]#
show_initial_fit() None[source]#

Displays the initial fit curve on the fitting display widget. Retrieves current TOF data and the initial parameter values from the view and evaluates the fitting model using these parameters to generate the initial fit curve.

update_fitting_function(fitting_obj: type[BaseFittingFunction]) None[source]#
update_roi_dropdown() None[source]#
update_roi_on_fitting_thumbnail() None[source]#
class mantidimaging.gui.windows.spectrum_viewer.fitting_form.FittingFormWidgetView(spectrum_viewer: SpectrumViewerWindowView)[source]#

Bases: QWidget

Widget for the form area of the fitting tab

Contains widgets for selecting fitting model and parameters

clear() None[source]#

Clear fitting form display and reset presenter state for reinitialisation.

property current_roi_name: str#
property current_sub_roi_coordinates: tuple[int, int]#
set_fit_quality(rss: float, rss_per_dof: float) None[source]#

Update the fit quality display with raw and reduced residual sum of squares.

showEvent(self, a0: Optional[QShowEvent])[source]#