Skip to content

ObjectivesWidget

ObjectivesWidget widget

This image generated from example code below.

ObjectivesWidget #

Bases: QWidget

A QComboBox-based Widget to select the microscope objective.

Parameters:

Name Type Description Default
objective_device str | None

Device label for the micromanager objective device. By default, it will be guessed using the CMMCorePlus.guessObjectiveDevices method and a choice dialog will be presented if there are multiple options. This method looks for a micromanager device matching the default regex re.compile("(.+)?(nosepiece|obj(ective)?)(turret)?s?", re.IGNORECASE). To change the search pattern, set CMMCorePlus.objective_device_pattern.

None
parent QWidget | None

Optional parent widget, by default None

None
mmcore CMMCorePlus | None

Optional pymmcore_plus.CMMCorePlus micromanager core. By default, None. If not specified, the widget will use the active (or create a new) CMMCorePlus.instance.

None

Example#

objectives_widget.py
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
from pymmcore_plus import CMMCorePlus
from qtpy.QtWidgets import QApplication

from pymmcore_widgets import ObjectivesWidget

app = QApplication([])

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

obj_wdg = ObjectivesWidget()
obj_wdg.show()

app.exec_()