Skip to content

PositionTable

PositionTable widget

This image generated from example code below.

PositionTable #

Bases: DataTableWidget

Table to edit a list of useq.Position.

load(file: str | Path | None = None) -> None #

Load positions from a JSON file and set the table value.

save(file: str | Path | None = None) -> None #

Save the current positions to a JSON file.

setValue(value: Sequence[useq.Position]) -> None #

Set the current value of the table from a Sequence of useq.Position.

Parameters:

Name Type Description Default
value Sequence[Position]

A Sequence of useq.Position.

required

value(exclude_unchecked: bool = True, exclude_hidden_cols: bool = True) -> Sequence[useq.Position] #

Return the current value of the table as a tuple of useq.Position.

Note that exclude_hidden_cols has the result of: - excluding the Z position in each of the Positions if include_z.isChecked() is False - excluding the AF offset in each of the Positions if af_per_position.isChecked() is False

Parameters:

Name Type Description Default
exclude_unchecked bool

Exclude unchecked rows, by default True

True
exclude_hidden_cols bool

Exclude hidden columns, by default True

True

Returns:

Type Description
tuple[Position, ...]

A tuple of useq.Position.

Example#

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

Check also the 'mda_widget.py' example to see the PositionTable
used in combination of other widgets.
"""

from pymmcore_plus import CMMCorePlus
from qtpy.QtWidgets import QApplication

from pymmcore_widgets import PositionTable

app = QApplication([])

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

pos_wdg = PositionTable(rows=3)
pos_wdg.resize(570, 200)
pos_wdg.show()

app.exec_()