Skip to content

PixelConfigurationWidget

PixelConfigurationWidget widget

This image generated from example code below.

PixelConfigurationWidget #

Bases: QWidget

A Widget to define the pixel size configurations.

Each pixel size configuration can be linked to any device and property. However, it's important to note that all pixel size configurations must include the same devices and properties. The only variation allowed between different configurations is in the values of the device properties.

Parameters:

Name Type Description Default
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

setValue(value: list[PixelSizePreset]) -> None #

Set the state of the widget describing the pixel configurations.

Parameters:

Name Type Description Default
value list[PixelSizePreset][PixelSizePreset]

The list of pixel configurations data to set.

required
Example:
input = [
    PixelSizePreset(
        name='Res10x',
        settings=[Setting('Objective', 'Label', 'Nikon 10X S Fluor')],
        pixel_size_um=1.0
    ),
    ...
]

value() -> list[PixelSizePreset] #

Return the current state of the widget describing the pixel configurations.

Returns:

Type Description
list[PixelSizePreset][PixelSizePreset]

A list of pixel configurations data.

Example:
output = [
    PixelSizePreset(
        name='Res10x',
        settings=[Setting('Objective', 'Label', 'Nikon 10X S Fluor')],
        pixel_size_um=1.0
    ),
    ...
]

Example#

pixel_configuration_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 PixelConfigurationWidget

app = QApplication([])

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

px_wdg = PixelConfigurationWidget()
px_wdg.show()

app.exec_()