Table of Contents

UCLA Miniscope v4 Configuration

The following excerpt from the UCLA Miniscope v4 example workflow demonstrates how to configure your UCLA Miniscope v4 and Breakout Board in Bonsai. This process comprises of the following steps:

~/workflows/hardware/ucla-miniscope-v4/configuration.bonsai workflow

NOTE

To learn more about the top-level configuration motif in every workflow involving ONIX hardware, visit the Configuration Chain Tutorial.

Creating an Acquisition Context

The CreateContext operator creates a ContextTask that defines the device driver and index where the hardware exists. The Driver property is set to "riffa" which is the name of the PCIe device used by ONIX. In this case, the Index property is set to 0 because there is only a single ONIX system. If a second system is used on the same computer, a second CreateContext operator would be required in its own configuration chain, with its Index property set to 1.

Configuring the UCLA Miniscope v4

The UclaMiniscopeV4 operator is set to configure the UCLA Miniscope v4; this can enable streaming of video data from a Python480 sensor and orientation data from a Bno055 IMU. This is accomplished in the UCLA Miniscope v4 example workflow by leaving all of the UclaMiniscopeV4 properties set to their default values.

When the workflow is started, the current time (based on Coordinated Universal Time) is saved, along with global hardware parameters governing data acquisition. This is accomplished using a TimeStamp operator to capture the computer's wall clock time. The timestamp is saved along with ContextTask's properties (e.g. AcquisitionClockHz, BlockReadSize, BlockWriteSize) to a csv file (start-time_<filecount>.csv) when the workflow is started.

Starting Acquisition

After starting a workflow, the StartAcquisition operator begins data acquisition with the hardware that has been configured. In the UCLA Miniscope v4 example workflow, most collected data is from the UCLA Miniscope v4. The rate of data being produced by the hardware will be ~11.1 MB/s. The ReadSize property is set to 8192 bytes, meaning data collection will wait until 8192 bytes of data have been produced by the hardware. At 11.1 MB/s the hardware will produce 8192 bytes every ~740 μs. This is a hard bound on the latency of the system. If lower latencies were required, the hardware would need to produce data more quickly or the ReadSize property value would need to be reduced.

The WriteSize property is set to 2048 bytes. This determines the amount of memory that is preallocated for temporarily holding data before it is sent to hardware. It is less critical to performance unless the rate that data be written to the hardware is comparable to the rate that the hardware produces data, which is not a common scenario.

NOTE

For an overview of the devices on the UCLA Miniscope v4 that can be configured through the ConfigureUclaMiniscopeV4 operator, visit the UCLA Miniscope v4 Overview.