API Reference¶
Information on the classes in the acquire
module along with the attributes and methods associated with them.
acquire.AvailableData
¶
The AvailableData class represents the collection of frames that have
been captured since the last call to runtime.get_available_data()
.
AvailableData
objects should be set to have a short lifetime, since these
objects reserve space on the video queue and will eventually block camera
acquisition to ensure no data is overwritten before it can be processed.
frames() -> Iterator[VideoFrame]
¶
Returns an iterator over the video frames in the available data.
Returns:
Type | Description |
---|---|
Iterator[VideoFrame]
|
An iterator over the video frames in the available data. |
acquire.AvailableDataContext
¶
The AvailableDataContext
class is the context manager for available
data for the given VideoStream ID.
acquire.Camera
¶
The Camera
class is used to describe cameras or other video sources.
Attributes:
Name | Type | Description |
---|---|---|
identifier |
Optional[DeviceIdentifier]
|
An optional attribute which contains an instance of the
|
settings |
CameraProperties
|
An instance of the |
acquire.CameraCapabilities
¶
The CameraCapabilities
class is used to describe the camera's
supported properties.
Attributes:
Name | Type | Description |
---|---|---|
exposure_time_us |
Property
|
An instance of the |
line_interval_us |
Property
|
An instance of the |
readout_direction |
Property
|
An instance of the |
binning |
Property
|
An instance of the |
offset |
OffsetCapabilities
|
An instance of the |
shape |
ShapeCapabilities
|
An instance of the |
supported_pixel_types |
List[SampleType]
|
A list containing instances of the |
digital_lines |
DigitalLineCapabilities
|
An instance of the |
triggers |
TriggerCapabilities
|
An instance of the |
acquire.CameraProperties
¶
The CameraProperties
class is used to set the desired camera properties
for acquisition.
Attributes:
Name | Type | Description |
---|---|---|
exposure_time_us |
float
|
How long in microseconds your camera should collect light from the sample. However, for simulated cameras, this is just a waiting period before generating the next frame. |
line_interval_us |
float
|
The time to scan one line in microseconds in a rolling shutter camera. |
binning |
float
|
How many adjacent pixels in each direction to combine by averaging.
For example, if |
pixel_type |
SampleType
|
An instance of the |
readout_direction |
Direction
|
An instance of the |
offset |
Tuple[int, int]
|
A tuple of two integers representing the (x, y) offset in pixels of the image region of interest on the camera. |
shape |
Tuple[int, int]
|
A tuple of two integers representing the (x, y)size in pixels of the image region of interest on the camera. |
input_triggers |
InputTriggers
|
An instance of the |
output_triggers |
OutputTriggers
|
An instance of the |
acquire.Capabilities
¶
The Capabilities
class contains representations of each of the 2
supported VideoStream objects.
Attributes:
Name | Type | Description |
---|---|---|
video |
Tuple[VideoStreamCapabilities, VideoStreamCapabilities]
|
A tuple containing two |
acquire.DeviceIdentifier
¶
Represents an identifier for a supported device, including its unique id and type, such as a camera or storage.
Attributes:
Name | Type | Description |
---|---|---|
id |
Tuple[int, int]
|
A tuple of |
kind |
DeviceKind
|
An instance of the |
name |
str
|
A string representing the name or label of the device. |
none() -> DeviceIdentifier
¶
Returns a "None" type DeviceIdentifier.
Useful when a DeviceIdentifier is not needed.
acquire.DeviceKind
¶
This class represents the types of devices in a given system.
Attributes:
Name | Type | Description |
---|---|---|
Camera |
DeviceKind
|
Enum-type class variable of |
NONE |
DeviceKind
|
Enum-type class variable of |
Signals |
DeviceKind
|
Enum-type class variable of |
StageAxis |
DeviceKind
|
Enum-type class variable of |
Storage |
DeviceKind
|
Enum-type class variable of |
acquire.DeviceManager
¶
The DeviceManager
class manages selection of available devices in the
system.
Regular expressions are accepted for the name argument.
devices() -> List[DeviceIdentifier]
¶
Returns a list of all available device identifiers.
select(kind: DeviceKind, name: Optional[str] = None) -> Optional[DeviceIdentifier]
¶
Selects a specified device.
Call this method to choose the first available device of a given type or to select a specific device by name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
kind |
DeviceKind
|
The type of device to select. |
required |
name |
Optional[str]
|
The name of the device to select. Regular expressions supported. |
None
|
Returns:
Type | Description |
---|---|
Optional[DeviceIdentifier]
|
The selected device identifier, or None if the specified device is |
Optional[DeviceIdentifier]
|
not available. |
select_one_of(kind: DeviceKind, names: List[str]) -> Optional[DeviceIdentifier]
¶
Selects the first device in the list of devices that is of one of the specified kinds.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
kind |
DeviceKind
|
The type of device to select. |
required |
names |
List[str]
|
A list of device names to choose from. Regular expressions supported. |
required |
Returns:
Type | Description |
---|---|
Optional[DeviceIdentifier]
|
Optional[DeviceIdentifier]: The selected device identifier, or None |
Optional[DeviceIdentifier]
|
if none of the specified devices are available. |
acquire.DeviceState
¶
The DeviceState
class represents the acquisition status of a device.
Attributes:
Name | Type | Description |
---|---|---|
Closed |
DeviceState
|
Enum-type class variable of |
AwaitingConfiguration |
DeviceState
|
Enum-type class variable of |
Armed |
DeviceState
|
Enum-type class variable of |
Running |
DeviceState
|
Enum-type class variable of |
acquire.DigitalLineCapabilities
¶
The DigitalLineCapabilities
class represents the digital lines
supported by the device.
Attributes:
Name | Type | Description |
---|---|---|
line_count |
int
|
Integer number representing the number of digital lines supported. |
names |
Tuple[str, ...]
|
Tuple of strings to name each of the digital lines, typically the last one is the camera software trigger. |
acquire.DimensionType
¶
Used to specify the physical meaning of a dimension, such as space or time dimension.
When downsampling, Space and Time dimensions are downsampled by the same factor. Channel and Other dimensions are not downsampled.
This value is also reflected in the dimension metadata of an OME-Zarr dataset.
Attributes:
Name | Type | Description |
---|---|---|
Space |
DimensionType
|
Enum-type class variable of |
Channel |
DimensionType
|
Enum-type class variable of |
Time |
DimensionType
|
Enum-type class variable of |
Other |
DimensionType
|
Enum-type class variable of |
acquire.Direction
¶
acquire.InputTriggers
¶
The InputTriggers
class represents input triggers for a camera device.
Attributes:
Name | Type | Description |
---|---|---|
acquisition_start |
Trigger
|
An instance of the |
exposure |
Trigger
|
An instance of the |
frame_start |
Trigger
|
An instance of the |
acquire.OffsetCapabilities
¶
acquire.OutputTriggers
¶
The OutputTriggers
class represents output triggers for a camera
device.
Attributes:
Name | Type | Description |
---|---|---|
exposure |
Trigger
|
An instance of the |
frame_start |
Trigger
|
An instance of the |
trigger_wait |
Trigger
|
An instance of the |
acquire.PID
¶
acquire.Properties
¶
The Properties
class represents properties related to video streams.
Attributes:
Name | Type | Description |
---|---|---|
video |
Tuple[VideoStream, VideoStream]
|
A tuple containing two |
acquire.Property
¶
Indicates the type of and whether the property can be overwritten.
For numerical values, it also captures the accepted range of values.
Attributes:
Name | Type | Description |
---|---|---|
writable |
bool
|
A boolean indicating whether the property can be written. |
low |
float
|
Floating point number for the lower bound of the property, if applicable. |
high |
float
|
Floating point number for the upper bound of the property, if applicable. |
kind |
PropertyType
|
An instance of the |
acquire.PropertyType
¶
The PropertyType
class indicates the type of the property (fixed
precision, floating-point, enum, or string).
Attributes:
Name | Type | Description |
---|---|---|
FixedPrecision |
PropertyType
|
Enum-type class variable of |
FloatingPrecision |
PropertyType
|
Enum-type class variable of |
Enum |
PropertyType
|
Enum-type class variable of |
String |
PropertyType
|
Enum-type class variable of |
acquire.Runtime
¶
Coordinates runtime.
The Runtime
class coordinates the devices with the storage disc
including selecting the devices, setting their properties, and starting and
stopping acquisition.
abort() -> None
¶
Aborts the runtime, terminating it immediately.
Call abort()
to immediately end data acqusition. All objects are
deleted to free up disk space upon shutdown of Runtime
.
device_manager() -> DeviceManager
¶
Returns the DeviceManager instance associated with this Runtime.
Call device_manager()
to return the DeviceManager
object associated
with this Runtime
instance.
execute_trigger(stream_id: int) -> None
¶
Executes a trigger for the given stream ID.
Call execute_trigger
with a specific stream_id
, 0 or 1, to execute
a trigger for that video source.
get_available_data(stream_id: int) -> AvailableDataContext
¶
Returns the AvailableDataContext instance for the given stream ID.
Call get_available_data
with a specific stream_id
, 0 or 1, to
return the context manager, AvailableDataContext
, associated with the
1st or 2nd video source, respectively.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
stream_id |
int
|
The ID of the stream for which available data is requested. |
required |
Returns:
Name | Type | Description |
---|---|---|
AvailableDataContext |
AvailableDataContext
|
Context manager for available data for the given VideoStream ID. |
get_capabilities() -> Capabilities
¶
Returns the current capabilites of the runtime as an instance of Capabilities.
Call get_capabilities()
to return the Capabilities
object associated
with this Runtime
instance.
get_configuration() -> Properties
¶
Returns the current configuration properties of the runtime.
Call get_configuration()
to return the Properties
object associated
with this Runtime
instance.
get_state() -> DeviceState
¶
Returns the current state of the device.
Call get_state()
to return the DeviceState
object associated with
this Runtime
instance.
set_configuration(properties: Properties) -> Properties
¶
Applies the provided configuration properties to the runtime.
Call set_configuration
with a Properties
object to change the
properties of this Runtime
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
properties |
Properties
|
The properties to be set. |
required |
Returns:
Type | Description |
---|---|
Properties
|
The updated configuration properties. |
start() -> None
¶
Starts the runtime, allowing it to collect data.
Call start()
to begin data acquisition.
stop() -> None
¶
Stops the runtime, ending data collection after the max number of frames is collected.
Call stop()
to end data acquisition once the max number of frames
specified in acquire.VideoStream.max_frame_count
is collected. All
objects are deleted to free up disk space upon shutdown of Runtime
.
acquire.SampleRateHz
¶
acquire.SampleType
¶
The SampleType
class defines the type of the values in the streamed
data.
Attributes:
Name | Type | Description |
---|---|---|
F32 |
SampleType
|
Enum-type class variable of |
I16 |
SampleType
|
Enum-type class variable of |
I8 |
SampleType
|
Enum-type class variable of |
U16 |
SampleType
|
Enum-type class variable of |
U8 |
SampleType
|
Enum-type class variable of |
U10 |
SampleType
|
Enum-type class variable of |
U12 |
SampleType
|
Enum-type class variable of |
U14 |
SampleType
|
Enum-type class variable of |
acquire.ShapeCapabilities
¶
Represents the size of the offset or the shape of the region of interest on the camera.
The sum of the offset and shape is the size of the full camera chip.
Attributes:
Name | Type | Description |
---|---|---|
x |
Property
|
An instance of the |
y |
Property
|
An instance of the |
acquire.SignalIOKind
¶
The SignalIOKind
class defines the signal type, input or output, for a
trigger.
Attributes:
Name | Type | Description |
---|---|---|
Input |
SignalIOKind
|
Enum-type class variable of |
Output |
SignalIOKind
|
Enum-type class variable of |
acquire.SignalType
¶
The SignalType
class specifies whether a signal is analog or digital.
Attributes:
Name | Type | Description |
---|---|---|
Analog |
SignalType
|
Enum-type class variable of |
Digital |
SignalType
|
Enum-type class variable of |
acquire.Storage
¶
The Storage
class represents storage devices and their settings.
Attributes:
Name | Type | Description |
---|---|---|
identifier |
Optional[DeviceIdentifier]
|
An optional attribute which contains an instance of the
|
settings |
StorageProperties
|
An instance of the |
acquire.StorageCapabilities
¶
The StorageCapabilities
class represents what types of data handling
is supported by the storage device.
Attributes:
Name | Type | Description |
---|---|---|
chunking_is_supported |
bool
|
A boolean indicating whether chunking is supported for this storage device. |
sharding_is_supported |
bool
|
A boolean indicating whether sharding is supported for this storage device. |
multiscale_is_supported |
bool
|
A boolean indicating whether multiscale storage is supported. |
acquire.StorageDimension
¶
Represents the type and size of the dimension for storage.
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
A string representing the name or label of the storage dimension. |
kind |
DimensionType
|
An instance of the |
array_size_px |
int
|
The size of the output array along this dimension, in pixels. The final (i.e., append) dimension must have size 0. |
chunk_size_px |
int
|
The size of a chunk along this dimension, in pixels. |
shard_size_chunks |
int
|
Integer number of chunks per shard. Shards enable aggregating multiple chunks into a single file. This value is ignored if sharding is not supported by the storage device. |
acquire.StorageProperties
¶
The StorageProperties
class represents properties for data storage.
Attributes:
Name | Type | Description |
---|---|---|
uri |
Optional[str]
|
The URI where the image data will be stored. |
external_metadata_json |
Optional[str]
|
Optional JSON-formatted metadata for the acquisition. |
s3_access_key_id |
Optional[str]
|
The access key ID for the S3 bucket. This value is only applicable for Zarr storage devices and S3 URIs. |
s3_secret_access_key |
Optional[str]
|
The secret access key for the S3 bucket. This value is only applicable for Zarr storage devices and S3 URIs. |
first_frame_id |
int
|
The ID of the first frame. |
pixel_scale_um |
Tuple[float, float]
|
A tuple of two floats representing the pixel size of the camera in micrometers. |
acquisition_dimensions |
List[StorageDimension]
|
A list of instances of the |
enable_multiscale |
bool
|
A boolean indicating whether multiscale storage is enabled. |
acquire.Trigger
¶
The Trigger
class represents a trigger signal.
Attributes:
Name | Type | Description |
---|---|---|
edge |
TriggerEdge
|
An instance of the |
enable |
bool
|
A boolean indicating whether the trigger is enabled. |
line |
int
|
An integer representing the max value of the trigger signal. |
kind |
SignalIOKind
|
An instance of the |
acquire.TriggerCapabilities
¶
Specifies what types of events the trigger can initiate.
Attributes:
Name | Type | Description |
---|---|---|
acquisition_start |
TriggerInputOutputCapabilities
|
An instance of the |
exposure |
TriggerInputOutputCapabilities
|
An instance of the |
frame_start |
TriggerInputOutputCapabilities
|
An instance of the |
acquire.TriggerEdge
¶
The TriggerEdge
class represents what edge of the trigger function
initiates the trigger.
Attributes:
Name | Type | Description |
---|---|---|
Falling |
TriggerEdge
|
Enum-type class variable of |
NotApplicable |
TriggerEdge
|
Enum-type class variable of |
Rising |
TriggerEdge
|
Enum-type class variable of |
AnyEdge |
TriggerEdge
|
Enum-type class variable of |
LevelLow |
TriggerEdge
|
Enum-type class variable of |
LevelHigh |
TriggerEdge
|
Enum-type class variable of |
acquire.TriggerInputOutputCapabilities
¶
Specifies which of the up to 8 supported digital lines can be used for either input or output triggering.
The 2 attributes, input and output, each are read-only values and 8-bit integers from the conversion of the 8 binary digit representation of the digital lines to a decimal integer.
Attributes:
Name | Type | Description |
---|---|---|
input |
int
|
8-bit integer representing which digital lines can be used for input triggering. For example, if lines 0 and 2 were available for input triggers, the 8 binary digit representation of the lines is 00000101, which is 5 in the decimal system. |
output |
int
|
8-bit integer representing which digital lines can be used for output triggering. For example, if lines 3 and 5 were available for output triggers, the 8 binary digit representation of the lines is 00101000, which is 40 in the decimal system. |
Examples:
If lines 0 and 2 were available for input triggers, the 8 binary digit representation would be 0b00000101, since the 8 available lines are zero indexed. 00000101 binary is 5 in the decimal system, so the input attribute would have a value of 5.
acquire.VideoFrame
¶
The VideoFrame
class represents data from acquisition of a frame.
data() -> NDArray[Any]
¶
Returns the data of the video frame as an NDArray.
Call data()
to create an NDArray of the VideoFrame
data.
metadata() -> VideoFrameMetadata
¶
Returns the metadata associated with the video frame.
Call metadata()
to create a VideoFrameMetadata
object containing
the metadata of VideoFrame
.
acquire.VideoFrameMetadata
¶
The VideoFrameMetadata
class represents metadata related to a video
frame.
Attributes:
Name | Type | Description |
---|---|---|
frame_id |
int
|
An integer representing the ID of the video frame. |
timestamps |
VideoFrameTimestamps
|
An instance of the |
acquire.VideoFrameTimestamps
¶
acquire.VideoStream
¶
The VideoStream
class represents a video stream.
Attributes:
Name | Type | Description |
---|---|---|
camera |
Camera
|
An instance of the |
storage |
Storage
|
An instance of the |
max_frame_count |
int
|
An integer representing the maximum number of frames to acquire. |
frame_average_count |
int
|
An integer representing the number of frames to average, if any, before streaming. The default value is 0, which disables this feature. Setting this to 1 will also prevent averaging. |
acquire.VideoStreamCapabilities
¶
The VideoStreamCapabilities
class captures the capabilities for a
video stream.
Attributes:
Name | Type | Description |
---|---|---|
camera |
CameraCapabilities
|
An instance of the CameraCapabilities class which represents the capabilities for the camera in this video stream. |
storage |
StorageCapabilities
|
An instance of the StorageCapabilities class which represents the capabilities for the storage device in this video stream. |
max_frame_count |
Property
|
An instance of the Property class. |
frame_average_count |
Property
|
An instance of the Property class. |
acquire.VoltageRange
¶
acquire._get_runtime() -> Runtime
¶
Potentially create and get the global acquire runtime.
acquire.core_api_version() -> str
¶
Returns the version string for the core API.
acquire.gui(viewer: napari.Viewer, frame_count: int = 100, stream_count: int = 2) -> None
¶
Napari dock-widget plugin entry-point
This instances a magicgui dock widget that streams video to a layer.
acquire.setup(runtime: Runtime, camera: Union[str, List[str]] = 'simulated: radial sin', storage: Union[str, List[str]] = 'Tiff', output_filename: Optional[str] = 'out.tif') -> Properties
¶
Set up the runtime with a camera and storage device.