Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Neuropixels headstage tutorials #71

Merged
merged 7 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions articles/getting-started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,5 @@ and Bonsai, and will teach them what ONIX is, how to download and install Bonsai
place operators (and understand what an operator is), reorder a workflow, run a workflow, and
finally visualize data.

For those who are already familiar with Bonsai and are looking for a particular device or headstage
to learn more about the hardware and how to utilize it, the table of contents on the left contains
entries for each available device and headstage. Choose a page to learn more about the hardware and
view a fully complete workflow that can be copied directly into Bonsai to aid in quickly setting up
and collecting data from a system.
For those who are already familiar with Bonsai and ONIX and are looking for a particular device or headstage
to learn about and how to utilize, visit the <xref:hardware>.
2 changes: 1 addition & 1 deletion articles/hardware/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ uid: hardware
title: Hardware Guides
---

Here you will find user guides for the ONIX breakout board, headstages, and other compatible hardware that are supported by the library.
Here you will find user guides for the ONIX breakout board, headstages, and other compatible hardware that are supported by the library.
8 changes: 8 additions & 0 deletions articles/hardware/np1e/bno055.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
uid: np1e_bno055
title: NeuropixelsV1e Bno055
hardware: NeuropixelsV1e Headstage
device: true
bno055: true
hardwareOperator: NeuropixelsV1eHeadstage
---
28 changes: 28 additions & 0 deletions articles/hardware/np1e/configuration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
uid: np1e_configuration
title: Neuropixels 1.0 Headstage Configuration
hardware: NeuropixelsV1e Headstage
configuration: true
operator: ConfigureNeuropixelsV1eHeadstage
dataRate: 20.6
timeUntilFullBuffer: 200 μs
blockReadSize: 4096
workflowLocation: overview
---

## Configuring the NeuropixelsV1e headstage
The `NeuropixelsV1eHeadstage` operator is used to configure the Neuropixels V1e Headstage; this can enable streaming of electrophysiology data from a Neuropixels 1.0 probe and orientation data from a Bno055 IMU. This is accomplished in the example workflow by leaving all of the `NeuropixelsV1eHeadstage` properties set to their default values.

Default values for the headstage are:
- Enabling the first 384 electrodes for streaming (electrodes 0 through 383)
- This is also known as the **Bank A** `Channel Preset`
- Setting `AP Gain` to 1000x
- Setting `LFP gain` to 50x
- Enabling the `Spike Filter`
- Setting the `Reference` to *External*

> [!WARNING]
> The workflow will not run unless gain calibration and ADC calibration files are provided. Click the `NeuropixelsV1eHeadstage` operator, expand `NeuropixelsV1e` in the property pane, then choose the appropriate files by selecting either `GainCalibrationFile` or `AdcCalibrationFile` and clicking the <kbd>...</kbd> button.

> [!TIP]
> For additional details on how to manually configure the headstage, such as enabling specific electrodes for recording, or modify AP / LFP gain, check out the xref:np1e_gui page.
22 changes: 22 additions & 0 deletions articles/hardware/np1e/npv1e.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
uid: np1e_npv1e
title: NeuropixelsV1e
hardware: NeuropixelsV1e Headstage
device: true
---

The following excerpt from the NeuropixelsV1e Headstage [example workflow](xref:np1e_npv1e-headstage) demonstrates NeuropixelsV1e functionality by streaming and saving probe data.

::: workflow
![/workflows/hardware/breakout/np1.bonsai workflow](../../../workflows/hardware/np1e/np1.bonsai)
:::

The <xref:OpenEphys.Onix1.NeuropixelsV1eData> operator generates a sequence of <xref:OpenEphys.Onix1.NeuropixelsV1eDataFrame>s using the following settings:
- `BufferSize` is set to 36.
- The `NeuropixelsV1eData`'s `DeviceName` property is set to "NeuropixelsV1eHeadstage/NeuropixelsV1e". This links the <xref:OpenEphys.Onix1.NeuropixelsV1eData> operator to the corresponding configuration operator.

Given the settings above, each frame will contain a [1 x 36 sample] `Clock` vector, a [384 channel x
36 sample] `SpikeData` matrix, and a [384 channel x 3 sample] `LfpData` matrix. This corresponds to 1.2 ms of data per data frame.
`LfpData` has less samples than `Clock` and `SpikeData` because `LfpData` is sampled at a lower rate; AP data is sampled at 30 kHz while LFP data is sampled at 2.5 kHz.

The relevant properties are extracted from the <xref:OpenEphys.Onix1.NeuropixelsV1eDataFrame> by right-clicking the <xref:OpenEphys.Onix1.NeuropixelsV1eData> operator, and choosing the following **Output** members: `Clock`, `SpikeData`, and `LfpData`. The [`MatrixWriter`](https://bonsai-rx.org/docs/api/Bonsai.Dsp.MatrixWriter.html) operators saves the selected members to files with the following format: `np1-clock_<timestamp>.raw`, `np1-spike_<timestamp>.raw`, and `np1-lfp_<timestamp>.raw`, respectively.
31 changes: 31 additions & 0 deletions articles/hardware/np1e/overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
uid: np1e_npv1e-headstage
title: NeuropixelsV1e Headstage
---

These are the devices available on the NeuropixelsV1e Headstage:

- One [NeuropixelsV1e](xref:np1e_npv1e):
- A single 1cm long shank probe with a 70 x 24 µm shank cross-section.
- 960-electrode low-impedance TiN electrodes total.
- 384 parallel, dual-band (AP, LFP), low-noise recording channels.
- AP band at 0.3-10 kHz, sampled at 30 kHz
- LFP band at 0.5-500 Hz, sampled at 2.5 kHz
- [Bno055](xref:np1e_bno055): 9-axis IMU for real-time, 3D orientation tracking, and easy automated commutation with Open Ephys commutators.

> [!TIP]
> Visit the [NeuropixelsV1e Headstage Hardware Guide](https://open-ephys.github.io/onix-docs/Hardware%20Guide/Headstages/headstage-neuropix-1e.html) to learn more about the hardware such as weight, dimensions, and proper power voltages.

The example workflow below can by copy/pasted into the Bonsai editor using the clipboard icon in the top right. This workflow:
- Captures data from the Bno055 IMU and NeuropixelsV1e probe, saving all data to disk.
- Monitors the the NeuropixelsV1e Headstage port status.
- Automatically commutates the tether if there is a proper commutator connection.

::: workflow
![/workflows/hardware/np1e/np1e.bonsai workflow](../../../workflows/hardware/np1e/np1e.bonsai)
:::

The following pages in the Neuropixels V1e Headstage Guide provide a breakdown of the above example workflow.

> [!TIP]
> Visit the <xref:getting-started> pages if you are unfamiliar with Bonsai.
8 changes: 8 additions & 0 deletions articles/hardware/np1e/port-status.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
uid: np1e_port-status
title: Port Status
hardware: NeuropixelsV1e Headstage
device: true
portStatus: true
hardwareOperator: NeuropixelsV1eHeadstage
---
8 changes: 8 additions & 0 deletions articles/hardware/np2e/bno055.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
uid: np2e_bno055
title: NeuropixelsV2e Bno055
hardware: NeuropixelsV2e Headstage
device: true
bno055: true
hardwareOperator: NeuropixelsV2eHeadstage
---
28 changes: 28 additions & 0 deletions articles/hardware/np2e/configuration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
uid: np2e_configuration
title: NeuropixelsV2e Headstage Configuration
hardware: NeuropixelsV2e Headstage
configuration: true
operator: ConfigureNeuropixelsV2eHeadstage
dataRate: 18.1
timeUntilFullBuffer: 220 μs
blockReadSize: 4096
workflowLocation: overview
---

> [!NOTE]
> The NeuropixelsV2eBeta Headstage functions nearly identically to the NeuropixelsV2e Headstage. Simply replace `ConfigureNeuropixelsV2eHeadstage` with `ConfigureNeuropixelsV2eBetaHeadstage`.

## Configuring the NeuropixelsV2e headstage
The `NeuropixelsV2eHeadstage` 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 `NeuropixelsV2eHeadstage` 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`
- Setting the `Reference` to *External*

> [!WARNING]
> The workflow will not run unless gain correction files are provided. Click the `NeuropixelsV2eHeadstage` operator, expand `NeuropixelsV2e` in the property pane, then choose the appropriate files by selecting either `GainCalibrationFileA` or `GainCalibrationFileB` and clicking the <kbd>...</kbd> 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, or modify AP / LFP gain, check out the <xref:np2e_gui> page.
Loading