ibl_alignment_gui.utils.qt.custom_widgets
Functions
Show, hide, and configure an axis on a pyqtgraph figure. |
|
Set the font size and optionally the axis width/height for a given axis in a pyqtgraph figure. |
Classes
Widget containing buttons and labels for fitting and navigating through moves. |
|
A custom widget that contains a group of checkboxes with a title. |
|
A custom color bar widget for visualizing scalar data ranges as a gradient. |
|
Abstract base widget for displaying electrophysiology and histogram figures. |
|
Widget for displaying ephys features and histology for a single shank and different configs. |
|
Widget for displaying ephys and histology for a single shank and two different configurations. |
|
A widget for displaying a fit plot with a checkbox in the top left corner of the display. |
|
A container widget for displaying multiple panels in either a grid layout or a tabbed layout. |
|
A widget that creates and manages a Histogram-based Lookup Table (LUT). |
|
A custom menu bar with tabs for different plot types and fit and display options. |
|
A reusable popup window with optional graphics layout support. |
|
Widget containing various dropdowns and buttons to select the data to load. |
|
Widget for displaying ephys features and histology for a single shank and configuration. |
|
Widget for displaying ephys and histology for a single shank and configuration. |
|
A custom widget that contains a range slider with labels and a reset button. |
- class ibl_alignment_gui.utils.qt.custom_widgets.ButtonWidget(parent=None)[source]
Bases:
QWidgetWidget containing buttons and labels for fitting and navigating through moves.
- Parameters:
parent (QtWidgets.QMainWindow) – The parent window
- buttons
A Bunch object containing the added buttons. Each button is a QPushButton object.
- Type:
Bunch
- labels
A Bunch object containing the added labels. Each label is a QLabel object.
- Type:
Bunch
- class ibl_alignment_gui.utils.qt.custom_widgets.CheckBoxGroup(title=None, orientation='horizontal', parent=None)[source]
Bases:
QGroupBoxA custom widget that contains a group of checkboxes with a title.
- Parameters:
title (str) – The title of the checkbox group.
options (list of str) – The labels for each checkbox.
parent (QtWidgets.QMainWindow, optional) – The parent window.
- checkboxes
A dictionary mapping option labels to their corresponding QCheckBox widgets.
- Type:
dict
- add_options(options)[source]
Add checkboxes for the provided options.
- Parameters:
options (list of str) – The list of options to create checkboxes for.
- Return type:
None
- get_checked()[source]
Get a list of currently checked options.
- Returns:
The labels of the checked checkboxes.
- Return type:
list of str
- class ibl_alignment_gui.utils.qt.custom_widgets.ColorBar(cmap_name, width=20, height=5, plot_item=None, cbin=256, orientation='horizontal')[source]
Bases:
GraphicsWidgetA custom color bar widget for visualizing scalar data ranges as a gradient.
This widget: - Creates a color gradient based on a Matplotlib colormap. - Displays it as a horizontal or vertical bar in a pyqtgraph scene. - Provides ticks and labels to indicate data levels. - Can map raw data values into corresponding QColor brushes.
- Parameters:
cmap_name (str) – Name of the Matplotlib colormap to use.
width (int, default=20) – The width of the color bar in scene units.
height (int, default=5) – The height of the color bar in scene units.
plot_item (pg.PlotItem, optional) – A plot item to which this color bar will be added. If provided, the widget is automatically inserted and its axes are prepared.
cbin (int, default=256) – Number of discrete color bins for the LUT.
orientation ({'horizontal', 'vertical'}, default='horizontal') – Orientation of the color bar.
- get_brush(data, levels=None)[source]
Convert numeric data values into QColor brushes based on the color bar’s LUT.
- Parameters:
data (ndarray) – Array of data values to map.
levels (tuple[float, float], optional) – Min/max values to normalize the data. Defaults to data range.
- Returns:
List of QColor objects corresponding to the data values.
- Return type:
list[QtGui.QColor]
- static get_color(cmap_name, cbin=256)[source]
Generate a pyqtgraph-compatible color map, LUT, and gradient from a given colormap.
- Parameters:
cmap_name (str) – Name of the Matplotlib colormap.
cbin (int, default=256) – Number of discrete bins for the LUT.
- Return type:
tuple[ColorMap,ndarray,QLinearGradient]- Returns:
map (pg.ColorMap) – A pyqtgraph ColorMap object.
lut (np.ndarray) – Lookup table for color mapping.
grad (QtGui.QLinearGradient) – Gradient object for rendering the bar.
- get_colour_map()[source]
Return the underlying LUT for this color bar.
- Returns:
Lookup table array.
- Return type:
ndarray
- get_ticks(n=3)[source]
Generate evenly spaced tick positions and labels based on the current color bar levels.
- Parameters:
n (int, default=3) – Number of ticks to generate.
- Returns:
A list of (position, label) pairs for axis ticks.
- Return type:
list[tuple[float, str]]
- paint(p, *args)[source]
Render the color bar gradient.
- Parameters:
p (QtGui.QPainter) – The painter used to draw the widget.
- Return type:
None
- set_axis(ticks=None, label=None, loc=None, extent=30)[source]
Configure the axis associated with this color bar.
- Parameters:
ticks (list[tuple[float, str]], optional) – Tick positions and labels.
label (str, optional) – Axis label text.
loc ({'top', 'bottom', 'left', 'right'}, optional) – Which axis to configure. Defaults based on orientation.
extent (int, default=30) – Height or width allocated for the axis (in scene units).
- Return type:
None
- set_levels(levels, label=None, n_ticks=2)[source]
Set the levels represented by the color bar and configure ticks and optional label.
- Parameters:
levels (tuple or list or np.ndarray) – The (min, max) data values for the color mapping.
label (str, optional) – Axis label text.
n_ticks (int, default=2) – Number of ticks to display on the axis.
- Return type:
None
- class ibl_alignment_gui.utils.qt.custom_widgets.ConfigWidget(parent=None)[source]
Bases:
QWidgetAbstract base widget for displaying electrophysiology and histogram figures.
Creates two pg.GraphicsLayoutWidget, one with the histology figures and one with electrophysiology figures for a given shank and configuration.
Subclasses must implement get_layout and create_ephys_figure_layout to provide the specific figure arrangements.
- Parameters:
parent (QWidgets.QMainWindow, optional) – The parent window
- ephys_area
The widget area for electrophysiology figures.
- Type:
pg.GraphicsLayoutWidget
- hist_area
The widget area for histology figures.
- Type:
pg.GraphicsLayoutWidget
- abstractmethod create_ephys_figure_layout(*args)[source]
Create and return the electrophysiology figure layout.
- static create_figure_area(layout, tracking=False)[source]
Wrap a GraphicsLayout in a GraphicsLayoutWidget for display.
- Parameters:
layout (pg.GraphicsLayout) – The layout to display.
tracking (bool, optional) – Whether to enable mouse tracking on the widget.
- Returns:
The created figure area widget.
- Return type:
pg.GraphicsLayoutWidget
- static create_hist_figure_layout(items)[source]
Build a histology figure layout for a single configuration.
- Parameters:
items (ShankView) – A ShankView object containing all the figure items for this configuration and shank.
- Returns:
fig_hist_layout – The created histology figure layout.
- Return type:
pg.GraphicsLayout
- class ibl_alignment_gui.utils.qt.custom_widgets.DualConfigFeatureWidget(items_default, items_non_default, parent=None)[source]
Bases:
ConfigWidgetWidget for displaying ephys features and histology for a single shank and different configs.
The histology figure is built from the figure items of the default configuration. The ephys figure shows the feature plot from both the default and non-default configurations side by side in one panel.
- Parameters:
items_default (ShankView) – A ShankView object containing all the figure items for the default configuration and shank.
items_non_default (ShankView) – A ShankView object containing all the figure items for the non-default configuration and shank
parent (QWidgets.QMainWindow, optional) – The parent window
- items_default
A ShankView object containing all the figure items for the default configuration and shank.
- Type:
- items_non_default
A ShankView object containing all the figure items for the non-default configuration and shank
- Type:
- header
A label widget for the header, provided by the subclass.
- Type:
QtWidgets.QLabel
- config
The probe configuration name, provided by the subclass.
- Type:
str
- idx
The index of the shank, provided by the subclass.
- Type:
int
- name
The name of the shank, provided by the subclass.
- Type:
str
- class ibl_alignment_gui.utils.qt.custom_widgets.DualConfigWidget(items_default, items_non_default, parent=None)[source]
Bases:
ConfigWidgetWidget for displaying ephys and histology for a single shank and two different configurations.
The histology figure is built from the figure items of the default configuration. The ephys figure shows the image, line and probe plots from both the default and non-default configurations, side by side in one panel.
- Parameters:
items_default (ShankView) – A ShankView object containing all the figure items for the default configuration and shank.
items_non_default (ShankView) – A ShankView object containing all the figure items for the non-default configuration and shank
parent (QWidgets.QMainWindow, optional) – The parent window
- items_default
A ShankView object containing all the figure items for the default configuration and shank.
- Type:
- items_non_default
A ShankView object containing all the figure items for the non-default configuration and shank
- Type:
- header
A label widget for the header, provided by the subclass.
- Type:
QtWidgets.QLabel
- config
The probe configuration name, provided by the subclass.
- Type:
str
- idx
The index of the shank, provided by the subclass.
- Type:
int
- name
The name of the shank, provided by the subclass.
- Type:
str
- class ibl_alignment_gui.utils.qt.custom_widgets.FitWidget(parent=None)[source]
Bases:
QWidgetA widget for displaying a fit plot with a checkbox in the top left corner of the display.
- Parameters:
parent (QWidgets.QMainWindow, optional) – The parent window
- fig_fit
The plot widget displaying the fit.
- Type:
pg.PlotWidget
- lin_fit_option
A checkbox to toggle linear fitting.
- Type:
QtWidgets.QCheckBox
- class ibl_alignment_gui.utils.qt.custom_widgets.GridTabSwitcher[source]
Bases:
QWidgetA container widget for displaying multiple panels in either a grid layout or a tabbed layout.
- custom_signal
A signal emitted when the layout is toggled
- Type:
QtCore.Signal(str)
- layout
The main vertical layout containing either the grid or tab widget.
- Type:
QtWidgets.QVBoxLayout
- panels
The panel widgets to add to the grid or tab widget.
- Type:
list[QtWidgets.QWidget]
- panel_names
The names of the panels (used for tab labels in tabbed mode).
- Type:
list[str]
- headers
Header labels to be shown on top of the panels
- Type:
tuple[QtWidgets.QLabel], optional
- tab_widget
The tab widget used in tabbed layout mode.
- Type:
QtWidgets.QTabWidget
- grid_widget
The grid widget for grid layout mode.
- Type:
QtWidgets.QSplitter
- top_grid, bottom_grid
Horizontal and vertical splitters used to create the grid layout.
- Type:
QtWidgets.QSplitter
- grid_layout
Whether the current layout is grid-based (True) or tabbed (False).
- Type:
bool
- add_grid_layout()[source]
Add the panels to a grid layout and show the grid widget. Supports 1-4 panels.
- Return type:
None
- add_tab_layout()[source]
Add the panels to a tabbed layout and show the tab widget.
- Return type:
None
- custom_signal
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.
- Type:
pyqtSignal(*types, name
- delete_widgets()[source]
Remove all panels from the current layout and delete the widgets.
- Return type:
None
- initialise(panels, names, headers=None)[source]
Initialize the widget with a set of panels and their names.
- Parameters:
panels (list[QtWidgets.QWidget]) – The panel widgets to be displayed.
names (list[str]) – The names corresponding to each panel (used for tab labels).
headers (list[QtWidgets.QLabel], optional) – Header labels associated with each panel.
- Return type:
None
- remove_grid_layout(delete=False)[source]
Remove all panels from the grid layout and hide the grid widget.
- Parameters:
delete (bool, default=False) – If True, deletes the widgets after removal.
- Return type:
None
- class ibl_alignment_gui.utils.qt.custom_widgets.LutWidget[source]
Bases:
GraphicsLayoutWidgetA widget that creates and manages a Histogram-based Lookup Table (LUT).
The LUT is used to synchronize image intensity levels across multiple displayed images.
- slice_lut
The histogram LUT item controlling intensity scaling.
- Type:
pg.HistogramLUTItem
- lut_layout
Internal layout container for the LUT item.
- Type:
pg.GraphicsLayout
- images
A list of pyqtgraph ImageItem instances to which LUT levels are applied.
- Type:
list
- lut_status
Whether the LUT is currently visible (True) or removed (False).
- Type:
bool
- lut_levels
The current intensity level range applied to all images.
- Type:
tuple or None
- add_lut()[source]
Add the LUT item back into the layout (if previously removed).
- Return type:
None
- remove_lut()[source]
Remove the LUT item from the layout (if not already removed).
- Return type:
None
- set_lut(imgs, cbar)[source]
Associate a list of images with this LUT and apply a color map.
- Parameters:
imgs (list) – A list of pyqtgraph ImageItem instances to be linked to this LUT.
cbar (ColorBar) – A ColorBar object
- class ibl_alignment_gui.utils.qt.custom_widgets.MenuWidget(parent=None)[source]
Bases:
QMenuBarA custom menu bar with tabs for different plot types and fit and display options.
- Parameters:
parent (QtWidgets.QMainWindow) – The parent window
- parent
The parent window
- Type:
QtWidgets.QMainWindow
- tabs
A dictionary containing the created tabs as Bunch objects. Each Bunch has keys ‘menu’ (the menu object)
- Type:
dict[str, Bunch]
- static add_actions(options, function, menu, group, set_checked=True, **kwargs)[source]
Add a list of actions to a menu and its corresponding QActionGroup.
- Parameters:
options (list of str) – Labels for the menu actions.
function (Callable) – Function to connect to each action’s triggered signal.
menu (QtWidgets.QMenu) – The menu to which actions will be added.
group (QtWidgets.QActionGroup) – The group for handling exclusive behavior.
set_checked (bool, optional) – If True, the first item will be checked by default.
**kwargs –
- data_onlybool, optional
If True, pass this as an extra argument to the callback
- Returns:
action_init – The name of the first action added (used as initial selection).
- Return type:
str
- static find_actions(text, action_group)[source]
Find an action by its label text in a QActionGroup.
- Parameters:
text (str) – The text label of the action to find.
action_group (QtWidgets.QActionGroup) – The group in which to search for the action.
- Returns:
The matching QAction if found, else None.
- Return type:
QtWidgets.QAction or None
- populate_exclusive_tab(name, callback, options=None, set_checked=True)[source]
Populate an exclusive tab with actions.
- Parameters:
name (str) – The name of the tab to populate.
callback (Callable) – Function to call when an action is triggered.
options (list of str, optional) – The options to add to the tab
set_checked (bool, optional) – If True, the first action will be pre-checked.
- Returns:
The name of the initially checked option, or None if no keys provided.
- Return type:
str or None
- populate_non_exclusive_tab(name, options)[source]
Populate a non-exclusive tab (regular menu) with actions and set shortcuts.
- Parameters:
name (str) – The name of the tab to populate.
options (dict) –
- Each item should be a tuple of:
(label, {‘callback’: Callable, ‘shortcut’: str (optional)})
- Return type:
None
- static remove_actions(action_group)[source]
Remove and delete all actions from the provided QActionGroup.
- Parameters:
action_group (QtWidgets.QActionGroup) – The group from which to remove all actions.
- Return type:
None
- static toggle_action(action_group, direction)[source]
Toggle through the actions in a QActionGroup, activating the next action in sequence.
- Parameters:
action_group (QtWidgets.QActionGroup) – The group of QAction items representing plots to toggle through
direction (int) – The direction to toggle (1 for next, -1 for previous)
- Return type:
None
- class ibl_alignment_gui.utils.qt.custom_widgets.PopupWindow(title, parent=None, size=(300, 300), graphics=True)[source]
Bases:
QWidgetA reusable popup window with optional graphics layout support.
This class serves as a base for creating popup windows that: - Are top-level, floating windows. - Can contain either a pyqtgraph GraphicsLayoutWidget or a standard QWidget with a layout. - Emit signals when the mouse enters, leaves, or when the window is closed. - Can be reused or retrieved by title using the _get_or_create class method.
Subclasses must implement the abstract setup() method to populate the popup content.
Signals
- closedQtCore.Signal(QtWidgets.QWidget)
Emitted when the popup is closed.
- leave: QtCore.Signal(QtWidgets.QWidget)
Emitted when the mouse leaves the widget area.
- enter: QtCore.Signal(QtWidgets.QWidget)
Emitted when the mouse enters the widget area.
- type title:
str- param title:
The window title.
- type title:
str
- type parent:
QMainWindow- param parent:
Parent widget. If provided, the popup closes automatically when the parent is destroyed.
- type parent:
QWidget, optional
- type size:
tuple|list- param size:
Initial window size (width, height).
- type size:
tuple or list, default=(300, 300)
- type graphics:
bool- param graphics:
If True, use a pg.GraphicsLayoutWidget as the content area, otherwise, use a standard QWidget with a QGridLayout.
- type graphics:
bool, default=True
- closeEvent(event, *args, **kwargs)[source]
Handle the window close event.
Emits the closed signal and calls the parent closeEvent.
- Parameters:
event (QCloseEvent) – The Qt close event.
- Return type:
None
- closed
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.
- Type:
pyqtSignal(*types, name
- enter
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.
- Type:
pyqtSignal(*types, name
- enterEvent(event, *args, **kwargs)[source]
Handle the mouse enter event.
Emits the enter signal and calls the parent enterEvent.
- Parameters:
event (QtCore.QEvent) – The Qt enter event.
- Return type:
None
- leave
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.
- Type:
pyqtSignal(*types, name
- class ibl_alignment_gui.utils.qt.custom_widgets.SelectionWidget(offline=False, config=False, parent=None)[source]
Bases:
QWidgetWidget containing various dropdowns and buttons to select the data to load.
The added items depend on how the gui is run. For example, in offline mode, a dialog to select the local folder is provided in place of some dropdowns.
- Parameters:
offline (bool) – Whether to run in offline mode (local file system) or online mode (connection to Alyx)
config (bool) – Whether a config dropdown should be added to allow selection of different probe configurations
parent (QtWidgets.QMainWindow) – The parent window
- offline
Offline or online mode
- Type:
bool
- config
Whether a config dropdown is added
- Type:
bool
- dropdowns
A dictionary containing the added dropdowns as Bunch objects. Each Bunch has keys ‘list’ (list of options), ‘combobox’ (the combobox widget), and ‘line’ (the line edit widget, if applicable)
- Type:
dict
- buttons
A dictionary containing the added buttons as Bunch objects. Each Bunch has keys ‘button’ (the button widget) and line (the line edit widget, if applicable)
- Type:
dict
- button_style
A dictionary containing the stylesheets for activated and deactivated buttons
- Type:
dict
- activate_data_button()[source]
Change the style of the load data button to the activated style.
- Return type:
None
- static create_combobox(editable=False)[source]
Create a combobox with an optional editable line edit.
- Parameters:
editable (bool) – Whether to add a line edit widget to the combobox
- Return type:
tuple[QStandardItemModel,QComboBox,QLineEdit|None,QCompleter|None]- Returns:
model (QtGui.QStandardItemModel) – The data model associated with the combobox. Items should be added to this model to populate the combobox.
combobox (QtGui.QComboBox) – The combobox widget.
line_edit (QtWidgets.QLineEdit or None) – The QLineEdit associated with the combobox if editable=True; otherwise None.
completer (QtWidgets.QCompleter or None)
- deactivate_data_button()[source]
Change the style of the load data button to the deactivated style.
- Return type:
None
- static populate_combobox(data, list_name, combobox, init=True)[source]
Populate a combobox and its associated model with a list or array of string options.
- Parameters:
data (list, np.ndarray, or dict of strings) – A list of strings to add to the widget.
list_name (QtGui.QStandardItemModel) – The model object to which items will be added.
combobox (QtWidgets.QComboBox) – The combo box widget to be populated and configured.
init (bool) – If init set the selected item to the first option in the list
- Return type:
None
- class ibl_alignment_gui.utils.qt.custom_widgets.SingleConfigFeatureWidget(items, parent=None)[source]
Bases:
ConfigWidgetWidget for displaying ephys features and histology for a single shank and configuration.
The ephys plot shows the feature plot.
- Parameters:
items (ShankView) – A ShankView object containing all the figure items for this configuration and shank.
parent (QWidgets.QMainWindow, optional) – The parent window
- items
A ShankView object containing all the figure items for this configuration and shank.
- Type:
- header
A label widget for the header, provided by the subclass.
- Type:
QtWidgets.QLabel
- config
The probe configuration name, provided by the subclass.
- Type:
str
- idx
The index of the shank, provided by the subclass.
- Type:
int
- name
The name of the shank, provided by the subclass.
- Type:
str
- create_ephys_figure_layout(items)[source]
Build an ephys figure layout for a single configuration.
- Parameters:
items (ShankView) – A ShankView object containing all the figure items for this configuration and shank.
- Returns:
fig_ephys_layout – The created ephys figure layout.
- Return type:
pg.GraphicsLayout
- class ibl_alignment_gui.utils.qt.custom_widgets.SingleConfigWidget(items, parent=None)[source]
Bases:
ConfigWidgetWidget for displaying ephys and histology for a single shank and configuration.
The ephys plot shows the image, probe and line plots in one display.
- Parameters:
items (ShankView) – A ShankView object containing all the figure items for this configuration and shank.
parent (QWidgets.QMainWindow, optional) – The parent window
- items
A ShankView object containing all the figure items for this configuration and shank.
- Type:
- header
A label widget for the header, provided by the subclass.
- Type:
QtWidgets.QLabel
- config
The probe configuration name, provided by the subclass.
- Type:
str
- idx
The index of the shank, provided by the subclass.
- Type:
int
- name
The name of the shank, provided by the subclass.
- Type:
str
- create_ephys_figure_layout(items)[source]
Build an ephys figure layout for a single configuration.
- Parameters:
items (ShankView) – A ShankView object containing all the figure items for this configuration and shank.
- Returns:
fig_ephys_layout – The created ephys figure layout.
- Return type:
pg.GraphicsLayout
- class ibl_alignment_gui.utils.qt.custom_widgets.SliderWidget(steps=100, slider_type=None, parent=None)[source]
Bases:
QGroupBoxA custom widget that contains a range slider with labels and a reset button.
- Parameters:
steps (int) – The number of discrete steps for the slider.
slider_type (str, optional) – An optional identifier for the slider type.
parent (QtWidgets.QMainWindow, optional) – The parent window.
- slider
The range slider widget.
- Type:
- slider_labels
A Bunch containing QLabel widgets for min, max, low, and high labels.
- Type:
Bunch
- slider_type
An optional identifier for the slider type.
- Type:
str or None
- intervals
The array of values corresponding to slider positions.
- Type:
np.ndarray or None
- max_levels
The maximum levels for the slider.
- Type:
list or None
- reset_button
The button to reset the levels.
- Type:
QtWidgets.QPushButton
- Signals
- -------
- released
Emitted when the slider is released. Returns the slider widget and its type.
- Type:
QtCore.Signal(QtWidgets.QWidget, str)
- reset
Emitted when the reset button is pressed. Returns the slider widget and its type.
- Type:
QtCore.Signal(QtWidgets.QWidget, str)
- static format_label(val)[source]
Format a float value for display on the slider labels.
- Parameters:
val (float) – The value to format
- Returns:
The formatted value as a string.
- Return type:
str
- get_slider_values()[source]
Get the current slider values.
- Returns:
The low and high values of the slider.
- Return type:
tuple of float
- released
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.
- Type:
pyqtSignal(*types, name
- reset
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.
- Type:
pyqtSignal(*types, name
- set_slider_intervals(min_max)[source]
Set the intervals and min and max values for the slider.
- Parameters:
min_max (list or np.ndarray) – The min and max values for the slider
- Return type:
None
- ibl_alignment_gui.utils.qt.custom_widgets.set_axis(fig, ax, show=True, label=None, pen='k', ticks=True)[source]
Show, hide, and configure an axis on a pyqtgraph figure.
- Parameters:
fig (pg.PlotWidget or pg.PlotItem) – The figure containing the axis to modify.
ax (str) – The orientation of the axis. Must be one of {‘left’, ‘right’, ‘top’, ‘bottom’}.
show (bool, optional) – Whether to show the axis (default is True).
label (str or None, optional) – The label text for the axis (default is None).
pen (str, optional) – The color for the axis line and text (default is ‘k’ for black).
ticks (bool, optional) – Whether to show axis ticks (default is True).
- Returns:
axis – The configured axis object.
- Return type:
pg.AxisItem
- ibl_alignment_gui.utils.qt.custom_widgets.set_font(fig, ax, ptsize=8, width=None, height=None)[source]
Set the font size and optionally the axis width/height for a given axis in a pyqtgraph figure.
- Parameters:
fig (pg.PlotItem or pg.PlotWidget) – The figure containing the axis to modify.
ax (str) – The orientation of the axis. Must be one of {‘left’, ‘right’, ‘top’, ‘bottom’}.
ptsize (int, optional) – Point size for the axis font (default is 8).
width (int, optional) – Width to set for the axis in pixels. Only applicable for vertical axes.
height (int, optional) – Height to set for the axis in pixels. Only applicable for horizontal axes.
- Return type:
None