Microscope class¶
The main microscope class handles microscope settings, passing these between the settings file and their appropriate components (camera, stage), basic metadata about the current device status, and interfacing with the separate camera and stage components.
Defines a microscope object, binding a camera and stage with basic functionality.
-
class
openflexure_microscope.microscope.
Microscope
(settings=<openflexure_microscope.config.OpenflexureSettingsFile object>, configuration=<openflexure_microscope.config.OpenflexureSettingsFile object>)[source]¶ A basic microscope object.
The camera and stage objects may already be initialised, and can be passed as arguments.
-
lock
= None¶ Composite lock for locking both camera and stage
Type: labthings.CompositeLock
-
camera
= None¶ Currently connected camera object
-
stage
= None¶ Currently connected stage object
-
setup
(configuration: dict)[source]¶ Attach microscope components based on initially passed configuration file
-
set_stage
(configuration: Optional[dict] = None, stage_type: Optional[str] = None)[source]¶ Set or change the stage geometry
-
state
¶ Dictionary of the basic microscope state.
Returns: Dictionary containing complete microscope state Return type: dict
-
update_settings
(settings: dict)[source]¶ Applies a settings dictionary to the microscope. Missing parameters will be left untouched.
-
read_settings
(full: bool = True) → dict[source]¶ Get an updated settings dictionary.
Reads current attributes and properties from connected hardware, then merges those with the currently saved settings.
This is to ensure that settings for currently disconnected hardware don’t get removed from the settings file.
-