engines#
Custom MicroManager MDAEngine subclasses used by mesofield.
Three flavours are provided, all subclasses of
pymmcore_plus.mda.MDAEngine:
MesoEngineDrives the mesoscope camera; loads an LED sequence on the Arduino switch in
MesoEngine.setup_sequence()and streams images out of the circular buffer inMesoEngine.exec_sequenced_event().PupilEngineDrives the pupil camera; optionally pulses an NI-DAQ line at sequence start (used for synchronisation with downstream instruments).
DevEngineHardware-free development engine. Streams whatever the camera backend produces with no Arduino/NIDAQ interaction; intended for mock cameras and CI.
- class mesofield.engines.MesoEngine[source]#
Bases:
MDAEngineMDA engine for the mesoscope camera.
Loads an LED switching sequence onto an Arduino driver in
setup_sequence(), then streams images out of the camera’s circular buffer inexec_sequenced_event(). Subclassespymmcore_plus.mda.MDAEngine.- __init__(mmc, use_hardware_sequencing=True)[source]#
- Parameters:
use_hardware_sequencing (bool)
- Return type:
None
- set_config(cfg)[source]#
Bind a live
ExperimentConfigto this engine.Called by the
Procedureorchestrator after hardware is up so the engine can reach the configured encoder.- Return type:
None
- setup_sequence(sequence)[source]#
Perform setup required before the sequence is executed.
- Parameters:
sequence (MDASequence)
- Return type:
SummaryMetaV1 | None
- exec_sequenced_event(event)[source]#
Execute a sequenced (triggered) event and return the image data.
This method is not part of the PMDAEngine protocol (it is called by exec_event, which is part of the protocol), but it is made public in case a user wants to subclass this engine and override this method.
- Parameters:
event (SequencedEvent)
- Return type:
Iterable[PImagePayload]
- class mesofield.engines.PupilEngine[source]#
Bases:
MDAEngineMDA engine for the pupil camera with optional NI-DAQ triggering.
On
setup_sequence()an NI-DAQ object may be loaded from the sequence metadata; onexec_sequenced_event()that NI-DAQ is pulsed at sequence start so other instruments can synchronise. Subclassespymmcore_plus.mda.MDAEngine.- __init__(mmc, use_hardware_sequencing=True)[source]#
- Parameters:
use_hardware_sequencing (bool)
- Return type:
None
- set_config(cfg)[source]#
Bind a live
ExperimentConfig.Caches the configured NI-DAQ device and (when more than one
CMMCorePlusis in play) a reference to the primary core.- Parameters:
cfg (ExperimentConfig)
- Return type:
None
- setup_sequence(sequence)[source]#
Resolve the NI-DAQ from sequence metadata and reset it for the run.
- Parameters:
sequence (MDASequence)
- Return type:
SummaryMetaV1 | None
- exec_sequenced_event(event)[source]#
Execute a sequenced (triggered) event and return the image data.
This method is not part of the PMDAEngine protocol (it is called by exec_event, which is part of the protocol), but it is made public in case a user wants to subclass this engine and override this method.
- Parameters:
event (SequencedEvent)
- Return type:
Iterable[PImagePayload]
- class mesofield.engines.DevEngine[source]#
Bases:
MDAEngineHardware-free development engine for mock cameras and CI.
Streams images out of the camera’s circular buffer with no Arduino or NI-DAQ interaction. Use this engine for development and tests that don’t have access to physical rig hardware.
- __init__(mmc, use_hardware_sequencing=True)[source]#
- Parameters:
use_hardware_sequencing (bool)
- Return type:
None
- set_config(cfg)[source]#
Bind a live
ExperimentConfigto this engine.- Return type:
None
- exec_sequenced_event(event)[source]#
Execute a sequenced (triggered) event and return the image data.
This method is not part of the PMDAEngine protocol (it is called by exec_event, which is part of the protocol), but it is made public in case a user wants to subclass this engine and override this method.
- Parameters:
event (SequencedEvent)
- Return type:
Iterable[PImagePayload]