Skip to content

ChannelTable

ChannelTable widget

This image generated from example code below.

ChannelTable #

Bases: DataTableWidget

Table to edit a list of useq.Channels.

channelGroups() -> Mapping[str, Sequence[str]] #

Return the current channel groups that can be selected in the table.

setChannelGroups(groups: Mapping[str, Sequence[str]] | None) -> None #

Set the channel groups that can be selected in the table.

Parameters:

Name Type Description Default
groups Mapping[str, Sequence[str]]

A mapping of group names to a sequence of config names.

required

setValue(value: Iterable[useq.Channel]) -> None #

Set the current value of the table from an Iterable of useq.Channels.

Parameters:

Name Type Description Default
value Iterable[Channel]

An Iterable of useq.Channels.

required

value(exclude_unchecked: bool = True) -> tuple[useq.Channel, ...] #

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

Parameters:

Name Type Description Default
exclude_unchecked bool

Exclude unchecked rows, by default True

True

Returns:

Type Description
tuple[Channel, ...]

A tuple of useq.Channels.

Example#

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

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

from pymmcore_plus import CMMCorePlus
from qtpy.QtWidgets import QApplication

from pymmcore_widgets import ChannelTable

app = QApplication([])

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

ch_table_wdg = ChannelTable(rows=1)
ch_table_wdg.setChannelGroups({"Channel": ["DAPI", "FITC"]})
ch_table_wdg.resize(500, 200)
ch_table_wdg.show()

app.exec_()