Skip to content

MDASequenceWidget

MDASequenceWidget widget

This image generated from example code below.

MDASequenceWidget #

Bases: QWidget

A widget that provides a GUI to construct and edit a useq.MDASequence.

This widget requires no connection to a microscope or core instance. It strictly deals with loading and creating useq-schema useq.MDASequence objects.

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

Load a useq.MDASequence from a file.

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

Save the current useq.MDASequence to a file.

setValue(value: useq.MDASequence) -> None #

Set the current value of the widget from a useq.MDASequence.

Parameters:

Name Type Description Default
value MDASequence

The useq.MDASequence to set.

required

value() -> useq.MDASequence #

Return the current value of the widget as a useq.MDASequence.

Returns:

Type Description
MDASequence

The current useq.MDASequence value of the widget.

Example#

mda_sequence_widget.py
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
"""MDASequenceWidget is a widget for creating a useq.MDASequence object.

It has no awareness of the CMMCorePlus object, and does not have a "run" button.
"""

import useq
from qtpy.QtWidgets import QApplication

from pymmcore_widgets import MDASequenceWidget

app = QApplication([])

wdg = MDASequenceWidget()
wdg.channels.setChannelGroups({"Channel": ["DAPI", "FITC"]})
wdg.time_plan.setValue(useq.TIntervalLoops(interval=0.5, loops=11))
wdg.valueChanged.connect(lambda: print(wdg.value()))
wdg.show()
app.exec()