Skip to content

GridPlanWidget

GridPlanWidget widget

This image generated from example code below.

GridPlanWidget #

Bases: QScrollArea

Widget to edit a useq-schema GridPlan.

fovHeight() -> float | None #

Return the current field of view height.

fovWidth() -> float | None #

Return the current field of view width.

mode() -> Mode #

Return the current mode, one of "number", "area", or "bounds".

setFovHeight(value: float) -> None #

Set the current field of view height.

setFovWidth(value: float) -> None #

Set the current field of view width.

setMode(mode: Mode | Literal['number', 'area', 'bounds'] | None = None) -> None #

Set the current mode, one of "number", "area", or "bounds".

Parameters:

Name Type Description Default
mode Mode | Literal['number', 'area', 'bounds'] | None

The mode to set. (If None, the mode is determined by the sender().data(), for internal usage)

None

setValue(value: useq.GridFromEdges | useq.GridRowsColumns) -> None #

Set the current value of the widget from a useq-schema GridPlan.

Parameters:

Name Type Description Default
value GridFromEdges | GridRowsColumns | GridWidthHeight

The useq-schema GridPlan to set.

required

sizeHint() -> QSize #

Return the size hint for the viewport.

value() -> useq.GridFromEdges | useq.GridRowsColumns | useq.GridWidthHeight #

Return the current value of the widget as a useq-schema GridPlan.

Returns:

Type Description
GridFromEdges | GridRowsColumns | GridWidthHeight

The current GridPlan value of the widget.

Example#

grid_plan_widget.py
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
"""Example usage of the GridPlanWidget class.

Check also the 'position_table.py' and 'mda_widget.py' examples to see the
GridPlanWidget used in combination of other widgets.
"""

from pymmcore_plus import CMMCorePlus
from qtpy.QtWidgets import QApplication

from pymmcore_widgets import GridPlanWidget

app = QApplication([])

mmc = CMMCorePlus().instance()
mmc.loadSystemConfiguration()

grid_wdg = GridPlanWidget()
grid_wdg.show()

app.exec_()