pymmcore_gui
¶
A Micro-Manager GUI based on pymmcore-widgets and pymmcore-plus.
Submodules
| Name | Description |
|---|---|
actions |
Actions: the commands behind pymmcore-gui's menus, toolbars and dock widgets. |
widgets |
Widgets that pymmcore-gui adds to those in pymmcore-widgets. |
Classes
| Name | Description |
|---|---|
ActionInfo |
Information for creating a QCoreAction. |
CoreAction |
Actions that act on the global CMMCore instance. |
MicroManagerGUI |
Micro-Manager minimal GUI. |
WidgetAction |
Widget Actions toggle/create singleton widgets. |
Functions
| Name | Description |
|---|---|
create_mmgui |
Initialize the pymmcore-gui application and Main Window. |
Classes¶
MicroManagerGUI
¶
MicroManagerGUI(*, mmcore: CMMCorePlus | None = None)
Bases: QMainWindow
Micro-Manager minimal GUI.
-
API Reference
pymmcore-gui
pymmcore_gui Functionscreate_mmgui
TOOLBARS
¶
TOOLBARS: Mapping[str, ToolDictValue] = {
Toolbar.CAMERA_ACTIONS: [CoreAction.SNAP, CoreAction.TOGGLE_LIVE],
Toolbar.OPTICAL_CONFIGS: OCToolBar,
Toolbar.WIDGETS: [
WidgetAction.CONSOLE,
WidgetAction.PROP_BROWSER,
WidgetAction.MDA_WIDGET,
WidgetAction.STAGE_CONTROL,
WidgetAction.CAMERA_ROI,
],
}
MENUS
¶
MENUS: Mapping[str, MenuDictValue] = {
Menu.PYMM_GUI: [WidgetAction.ABOUT],
Menu.WINDOW: _create_window_menu,
Menu.DEVICE: [
WidgetAction.PROP_BROWSER,
WidgetAction.CONFIG_WIZARD,
None,
CoreAction.LOAD_CONFIG,
CoreAction.LOAD_DEMO,
CoreAction.SAVE_CONFIG,
None,
WidgetAction.INSTALL_DEVICES,
],
Menu.HELP: [],
}
nm
property
¶
A callable that can be used to show a message in the status bar.
get_widget
¶
get_widget(key: Literal[CAMERA_ROI], create: bool = ...) -> CameraRoiWidget
get_widget(
key: Literal[CONFIG_GROUPS], create: bool = ...
) -> GroupPresetTableWidget
get_widget(key: Literal[CONFIG_WIZARD], create: bool = ...) -> ConfigWizard
get_widget(key: Literal[EXCEPTION_LOG], create: bool = ...) -> ExceptionLog
get_widget(key: Literal[INSTALL_DEVICES], create: bool = ...) -> InstallWidget
get_widget(key: Literal[MDA_WIDGET], create: bool = ...) -> MDAWidget
get_widget(
key: Literal[PIXEL_CONFIG], create: bool = ...
) -> PixelConfigurationWidget
get_widget(key: Literal[PROP_BROWSER], create: bool = ...) -> PropertyBrowser
get_widget(
key: Literal[STAGE_CONTROL], create: bool = ...
) -> StagesControlWidget
Get (or create) widget for key ensuring that it is linked to its QAction.
If the widget has been "closed" (hidden), it will be re-shown.
Note that all widgets created this way are singletons, so calling this method multiple times will return the same widget instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
WidgetAction
|
The widget to get. |
required |
create
|
bool
|
Whether to create the widget if it doesn't exist yet, by default True. |
True
|
Raises:
| Type | Description |
|---|---|
KeyError
|
If the widget doesn't exist and |
get_dock_widget
¶
get_dock_widget(key: str) -> CDockWidget
Get the QDockWidget for key.
Note, you can also get the QDockWidget by calling get_widget(key), and then
calling widget.parent(). The parent will either be an instance of
QDockWidget (if it's actually a docked widget), or MicroManagerGUI, if
it's not docked. You should use isisinstance in this case to check.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
WidgetAction
|
The key for the inner widget owned by the requested QDockWidget. |
required |
Raises:
| Type | Description |
|---|---|
KeyError
|
If the widget doesn't exist. |
restore_state
¶
restore_state(*, show: bool = False) -> None
Restore the state of the window from settings (or load default state).
show is added as a convenience here because it may be a common use case to restore the state in a single shot timer and (only) then show the window. This avoids the window flashing on the screen before it is properly positioned.
ActionInfo
¶
Bases: BaseModel
Information for creating a QCoreAction.
-
API Reference
pymmcore-gui
pymmcore_guiactions Re-exports
-
API Reference
pymmcore-gui
pymmcore_guiactions ClassesWidgetActionInfo
to_qaction
¶
to_qaction(mmc: CMMCorePlus, parent: QObject | None = None) -> QCoreAction
Create a QCoreAction from this info.
widget_actions
classmethod
¶
widget_actions() -> dict[str, WidgetActionInfo]
Return all widget actions.
CoreAction
¶
Bases: ActionKey
Actions that act on the global CMMCore instance.
-
API Reference
pymmcore-gui
pymmcore_guiactions
SNAP
¶
TOGGLE_LIVE
¶
LOAD_DEMO
¶
LOAD_CONFIG
¶
-
API Reference
pymmcore-gui
pymmcore_gui ClassesMicroManagerGUIMENUS
SAVE_CONFIG
¶
-
API Reference
pymmcore-gui
pymmcore_gui ClassesMicroManagerGUIMENUS
WidgetAction
¶
Bases: ActionKey
Widget Actions toggle/create singleton widgets.
-
API Reference
pymmcore-gui
pymmcore_guiactions
Functions¶
create_mmgui
¶
create_mmgui(
*,
mm_config: Path | str | None | Literal[False] = None,
mmcore: CMMCorePlus | None = None,
install_sys_excepthook: bool = True,
install_sentry: bool = True,
exec_app: bool = True,
) -> MicroManagerGUI
Initialize the pymmcore-gui application and Main Window.
This is the primary way to start pymmcore-gui. (It is also called by
__main__.main() when running from the command line.)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mm_config
|
str | None | False
|
The path to the Micro-Manager configuration file to load.
- If |
None
|
mmcore
|
CMMCorePlus | None
|
The CMMCorePlus instance to use. If |
None
|
install_sys_excepthook
|
bool
|
If True (the default), installs a custom excepthook that does not raise sys.exit(). This is necessary to prevent the application from closing when an unhandled exception is raised in the main thread. |
True
|
install_sentry
|
bool
|
If True (the default), the user will be given an option to send error reports to the developers, unless they have previously opted in/out. If False, no prompt will be shown, and no error reports will be sent. |
True
|
exec_app
|
bool
|
If True (the default), the QApplication event loop will be started. If
False, the event loop will not be started, and the caller is responsible for
starting it with |
True
|