Event¶
An MDAEvent describes one thing for the microscope to do
(usually: acquire an image), and the hardware state to do it in. Fields that are
left as None mean "use the current setting". Iterating over an
MDASequence yields events, but you can also create them yourself.
useq.MDAEvent
¶
Bases: UseqModel
Define a single event in a MDASequence.
Usually, this object will be generated by iterating over a
MDASequence (see useq.MDASequence.iter_events).
Attributes:
| Name | Type | Description |
|---|---|---|
index |
ReadOnlyDict
|
Index of this event in the sequence. This is a mapping of axis name
to index. For example: |
channel |
Channel | None
|
Channel to use for this event. If |
exposure |
float | None
|
Exposure time in milliseconds. If not provided, implies use current exposure
time. By default, |
min_start_time |
float | None
|
Minimum start time of this event, in seconds. If provided, the engine will
pause until this time has elapsed before starting this event. Times are
relative to the start of the sequence, or the last event with
|
pos_name |
str | None
|
The name assigned to the position. By default, |
x_pos |
float | None
|
X position in microns. If not provided, implies use current position. By
default, |
y_pos |
float | None
|
Y position in microns. If not provided, implies use current position. By
default, |
z_pos |
float | None
|
Z position in microns. If not provided, implies use current position. By
default, |
slm_image |
SLMImage | None
|
Image data to display on an SLM device. |
sequence |
MDASequence | None
|
A reference to the |
properties |
list[PropertyTuple] | None
|
List of |
roi |
CameraROI | None
|
Camera region of interest. Accepts a |
metadata |
dict[str, Any]
|
Optional metadata to be associated with this event. This is the place for any user-defined data (for example, parameters that a custom acquisition engine needs). |
action |
HardwareAutofocus | AcquireImage | CustomAction
|
The action to perform for this event. By default, |
keep_shutter_open |
bool
|
If |
reset_event_timer |
bool
|
If |
- API Reference
- Getting Started
-
User Guide
- Advanced Topics Pycro-Manager-Style API
- Running Acquisitions
- useq-schema
-
API Reference
-
pymmcore-plus
pymmcore_plus - useq-schema
-
pymmcore-plus
useq.EventChannel
¶
Bases: UseqModel
Channel in a MDA event.
Attributes:
| Name | Type | Description |
|---|---|---|
config |
str
|
Name of the configuration to use for this channel, (e.g. |
group |
str
|
Optional name of the group to which this channel belongs. By default,
|
-
API Reference
useq-schema
useqv2 Re-exports - User Guide Running Acquisitions The Acquisition Engine The MDAEvent object
useq.PropertyTuple
¶
Bases: NamedTuple
Three-tuple capturing a device, property, and value.
Attributes:
| Name | Type | Description |
|---|---|---|
device_name |
str
|
Name of a device. |
property_name |
str
|
Name of a property recognized by the device. |
property_value |
Any
|
Value for the property. |
- API Reference useq-schema
Event Actions¶
useq.Action
¶
Bases: FrozenModel
Base class for a useq.MDAEvent action.
An Action specifies what task should be performed during a
useq.MDAEvent. An Action can be for example used to acquire an
image (useq.AcquireImage) or to perform a hardware autofocus
(useq.HardwareAutofocus). An action of None implies AcquireImage.
You may use CustomAction to indicate any custom action, with the data attribute
containing any data required to perform the custom action.
Attributes:
| Name | Type | Description |
|---|---|---|
type |
str
|
Type of the action that should be performed at the |
- API Reference useq-schema Event
useq.AcquireImage
¶
Bases: Action
useq.Action to acquire an image.
Attributes:
| Name | Type | Description |
|---|---|---|
type |
Literal['acquire_image']
|
This action can be used to acquire an image. |
- API Reference useq-schema
useq.HardwareAutofocus
¶
Bases: Action
useq.Action to perform a hardware autofocus.
See also useq.AutoFocusPlan.
Attributes:
| Name | Type | Description |
|---|---|---|
type |
Literal['hardware_autofocus']
|
This action can be used to trigger hardware autofocus. |
autofocus_device_name |
str | None
|
The name of the autofocus offset motor device (if applicable). If |
autofocus_motor_offset |
float | None
|
Before autofocus is performed, the autofocus motor should be moved to this offset, if applicable. (Not all autofocus devices have an offset motor.) If None, the autofocus motor should not be moved. |
max_retries |
int
|
The number of retries if autofocus fails. By default, 3. |
- API Reference useq-schema
-
API Reference
useq-schema
Hardware Autofocus Plan
AutoFocusPlanas_action
useq.CustomAction
¶
Bases: Action
useq.Action to perform a custom action.
This is a generic user action that can be used to represent anything that is not covered by the other action types, such as a microfluidic event, or a photostimulation, etc...
The data attribute is a dictionary that can contain any data that is needed to
perform the custom action. It must be serializable to JSON by pydantic.
Attributes:
| Name | Type | Description |
|---|---|---|
type |
Literal['custom']
|
This action can be used to perform a custom action. |
name |
str
|
A name for the custom action (not to be confused with the |
data |
dict
|
Custom data associated with the action. |
-
API Reference
useq-schema
useqv2 Re-exports