microscope.gui module

Simple GUIs for individual devices.

This is meant as a simple GUIs for help during development. It does not aim to be pretty; it aims to be simple, complete, and work on any OS and Python without extra work. It is not meant as the basis for a full-fledged microscope GUI.

This module requires qtpy which is a requirement for the microscope “GUI” extra, i.e., only installed by pip if microscope is installed with pip install microscope[GUI].

class microscope.gui.CameraWidget(device: microscope.abc.Camera, *args, **kwargs)[source]

Bases: PyQt5.QtWidgets.QWidget

Display camera

displayData(data: numpy.ndarray)None[source]

Update UI and camera state after enable check box

class microscope.gui.ControllerWidget(device: microscope.abc.Controller, *args, **kwargs)[source]

Bases: PyQt5.QtWidgets.QWidget

Show devices in a controller.

This widget shows a series of buttons with the name of the multiple devices in a controller. Toggling those buttons displays or hides a widget for that controlled device.

toggleDeviceWidget(button: PyQt5.QtWidgets.QAbstractButton, checked: bool)None[source]
class microscope.gui.DeformableMirrorWidget(device: microscope.abc.DeformableMirror, *args, **kwargs)[source]

Bases: PyQt5.QtWidgets.QWidget

Display a slider for each actuator.

Constructing this widget will set all actuators to their mid-point since the actuators position are not queryable.. The reset button does this too, i.e., it sets all actuators to their mid-point.


Set all actuators to their mid-point (0.5).

setActuatorValue(actuator_index: int, value: int)None[source]
class microscope.gui.DeviceSettingsWidget(device: microscope.abc.Device, *args, **kwargs)[source]

Bases: PyQt5.QtWidgets.QWidget

Table of device settings and its values.

This widget simply shows the available settings on the device and their current value. In the future it may add the possibility to modify them.

class microscope.gui.FilterWheelWidget(device: microscope.abc.FilterWheel, *args, **kwargs)[source]

Bases: PyQt5.QtWidgets.QWidget

Group of toggle push buttons to change filter position.

This widget shows a table of toggle buttons with the filterwheel position numbers.

class microscope.gui.LightSourceWidget(device: microscope.abc.LightSource, *args, **kwargs)[source]

Bases: PyQt5.QtWidgets.QWidget


Update UI and light source state after enable check box

class microscope.gui.MainWindow(widget: PyQt5.QtWidgets.QWidget, *args, **kwargs)[source]

Bases: PyQt5.QtWidgets.QMainWindow

class microscope.gui.StageWidget(device: microscope.abc.Stage, *args, **kwargs)[source]

Bases: PyQt5.QtWidgets.QWidget

Stage widget displaying each of the axis position.

This widget shows each of the axis, their limits, and a spin box to change the axis position. This requires the stage to be enabled since otherwise it is not able to move it or query the limits.

setPosition(name: str, position: float)None[source]
microscope.gui.main(argv: Sequence[str])int[source]