NeuropixelsV2e Headstage Configuration
The following excerpt from the NeuropixelsV2e Headstage example workflow demonstrates how to configure your NeuropixelsV2e Headstage and Breakout Board in Bonsai. This process comprises of the following steps:
- Create an ONIX acquisition context using CreateContext
- Configure the NeuropixelsV2e Headstage and the Breakout Board using ConfigureHeadstageNeuropixelsV2e and ConfigureBreakoutBoard
- Start acquisition using StartAcquisition.
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.
Note
The NeuropixelsV2eBeta Headstage functions nearly identically to the NeuropixelsV2e
Headstage. Simply replace ConfigureHeadstageNeuropixelsV2e
with
ConfigureHeadstageNeuropixelsV2eBeta
.
Configuring the NeuropixelsV2e headstage
The HeadstageNeuropixelsV2e
operator is set to configure the NeuropixelsV2e Headstage; this can
enable streaming of electrophysiology data from a Neuropixels 2.0 probe and orientation data from a
Bno055 IMU. This is accomplished in the NeuropixelsV2e Headstage example workflow by leaving all of
the HeadstageNeuropixelsV2e
properties set to their default values.
Default values for the headstage are:
- Enabling the first 384 electrodes of the first shank for streaming (shank 0, electrodes 0 through 383)
- This is also known as the Shank 0 Bank A
Channel Preset
- This is also known as the Shank 0 Bank A
- Setting
Reference
to External - Setting
Invert Polarity
toTrue
Important
The workflow will not run unless gain correction files are provided. Click the
HeadstageNeuropixelsV2e
operator, expand NeuropixelsV2e
in the property pane, then choose the
appropriate files by selecting either GainCalibrationFileA
or GainCalibrationFileB
and
clicking the ... button. If only one probe is plugged in, only one file is required.
Tip
For additional details on how to manually configure the headstage, such as enabling specific electrodes for recording, check out the NeuropixelsV2e GUI page.
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 NeuropixelsV2e Headstage example workflow, most collected data is from the NeuropixelsV2e Headstage. The rate of data being produced by the hardware will be ~18.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 18.1 MB/s the hardware will produce 8192 bytes every ~440 μ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 NeuropixelsV2e Headstage that can be configured through the ConfigureHeadstageNeuropixelsV2e operator, visit the NeuropixelsV2e Headstage Overview.