mantidimaging.gui.windows.spectrum_viewer.spectrum_widget module#
- class mantidimaging.gui.windows.spectrum_viewer.spectrum_widget.CustomViewBox(*args, **kwds)[source]#
Bases:
ViewBox
- keyPressEvent(event: QEvent) None [source]#
This routine should capture key presses in the current view box. Key presses are used only when mouse mode is RectMode The following events are implemented: ctrl-A : zooms out to the default “full” view of the plot ctrl-+ : moves forward in the zooming stack (if it exists) ctrl– : moves backward in the zooming stack (if it exists)
- class mantidimaging.gui.windows.spectrum_viewer.spectrum_widget.SpectrumPlotWidget[source]#
Bases:
GraphicsLayoutWidget
- range_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.
- range_control: LinearRegionItem#
- spectrum: PlotItem#
- class mantidimaging.gui.windows.spectrum_viewer.spectrum_widget.SpectrumProjectionWidget(main_window: MainWindowView)[source]#
Bases:
GraphicsLayoutWidget
- image: MIMiniImageView#
- class mantidimaging.gui.windows.spectrum_viewer.spectrum_widget.SpectrumROI(name: str, sensible_roi: SensibleROI, *args, **kwargs)[source]#
Bases:
ROI
Spectrum ROI object subclassed from pyqtgraph ROI containing ROI and associated data.
@param name: Name of the ROI @param sensible_roi: Sensible ROI object containing the ROI data @param args: Arguments to pass to the ROI object @param kwargs: Keyword arguments to pass to the ROI object
- adjust_spec_roi(roi: SensibleROI) None [source]#
- property roi: ROI#
- sig_colour_change#
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.spectrum_widget.SpectrumWidget(main_window: MainWindowView)[source]#
Bases:
QWidget
The widget containing the spectrum plot and the image projection.
@param parent: The parent widget
- add_roi(roi: SensibleROI, name: str) None [source]#
Add an ROI to the image view.
@param roi: The ROI to add. @param name: The name of the ROI.
- adjust_roi(new_roi: SensibleROI, roi_name: str) None [source]#
Adjust the existing ROI with the given name. @param new_roi: The new SpectrumROI to replace the existing SpectrumROI @param roi_name: The name of the existing ROI.
- change_roi_colour(name: str, colour: tuple[int, int, int, int]) None [source]#
Change the colour of an existing ROI
- colour_generator() tuple[int, int, int, int] [source]#
A random colour generator to colour ROIs boarders. Generates colours that are easy to see for colour blind people if colour_blind_friendly is True. By default colour_blind_friendly is set to False
@return: A random colour in RGBA format. (0-255, 0-255, 0-255, 0-255)
- get_roi(roi_name: str) SensibleROI [source]#
Get the ROI with the given name. If no name is given, the default ROI is returned.
@param roi_name: The name of the ROI to return. @return: The ROI with the given name.
- image: MIMiniImageView#
- image_widget: SpectrumProjectionWidget#
- range_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.
- range_control: LinearRegionItem#
- remove_roi(roi_name: str) None [source]#
Remove a given ROI by name unless it is ‘roi’ or ‘all’.
@param roi_name: The name of the ROI to remove.
- rename_roi(old_name: str, new_name: str) None [source]#
Rename a given ROI and corresponding spectrum by name unless it is called ‘roi’ or ‘all’
@param old_name: The name of the ROI to rename. @param new_name: The new name of the ROI. @raise KeyError: If the new name is already in use or equal to ‘roi’ or ‘all’.
- roiColorChangeRequested#
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.
- 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.
- roi_clicked#
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_visibility_flags(name: str, visible: bool) None [source]#
Change the visibility of an existing ROI including handles and update the ROI dictionary.
@param name: The name of the ROI. @param visible: The new visibility of the ROI.
- spectrum: PlotItem#
- spectrum_plot_widget: SpectrumPlotWidget#