Event#
MDAEvent
#
Define a single event in a MDASequence.
Usually, this object will be generator by iterating over a
MDASequence (see useq.MDASequence.iter_events).
Attributes:
| Name | Type | Description |
|---|---|---|
index |
dict[str, int]
|
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 |
Sequence[PropertyTuple] | None
|
List of |
roi |
CameraROI | None
|
Camera region of interest. Accepts a |
metadata |
dict
|
Optional metadata to be associated with this event. |
action |
Action
|
The action to perform for this event. By default, |
keep_shutter_open |
bool
|
If |
reset_event_timer |
bool
|
If |
Channel
#
PropertyTuple
#
Event Actions#
Action
#
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 |
AcquireImage
#
useq.Action to acquire an image.
Attributes:
| Name | Type | Description |
|---|---|---|
type |
Literal['acquire_image']
|
This action can be used to acquire an image. |
HardwareAutofocus
#
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, optional)
|
The name of the autofocus offset motor device (if applicable). If |
autofocus_motor_offset |
(float, optional)
|
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. |
CustomAction
#
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, optional)
|
A name for the custom action (not to be confused with the |
data |
(dict, optional)
|
Custom data associated with the action. |