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

Content for spike detection tut #143

Merged
merged 21 commits into from
Nov 13, 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
3 changes: 3 additions & 0 deletions .bonsai/Bonsai.config
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<Package id="Bonsai.Audio" version="2.8.0" />
<Package id="Bonsai.Core" version="2.8.5" />
<Package id="Bonsai.Design" version="2.8.5" />
<Package id="Bonsai.Dsp" version="2.8.1" />
<Package id="Bonsai.Editor" version="2.8.5" />
<Package id="Bonsai.Osc" version="2.7.0" />
<Package id="Bonsai.Scripting.Expressions" version="2.8.0" />
Expand Down Expand Up @@ -44,6 +45,7 @@
<AssemblyReference assemblyName="Bonsai.Audio" />
<AssemblyReference assemblyName="Bonsai.Core" />
<AssemblyReference assemblyName="Bonsai.Design" />
<AssemblyReference assemblyName="Bonsai.Dsp" />
<AssemblyReference assemblyName="Bonsai.Editor" />
<AssemblyReference assemblyName="Bonsai.Osc" />
<AssemblyReference assemblyName="Bonsai.Scripting.Expressions" />
Expand All @@ -62,6 +64,7 @@
<AssemblyLocation assemblyName="Bonsai.Audio" processorArchitecture="MSIL" location="Packages/Bonsai.Audio.2.8.0/lib/net462/Bonsai.Audio.dll" />
<AssemblyLocation assemblyName="Bonsai.Core" processorArchitecture="MSIL" location="Packages/Bonsai.Core.2.8.5/lib/net462/Bonsai.Core.dll" />
<AssemblyLocation assemblyName="Bonsai.Design" processorArchitecture="MSIL" location="Packages/Bonsai.Design.2.8.5/lib/net462/Bonsai.Design.dll" />
<AssemblyLocation assemblyName="Bonsai.Dsp" processorArchitecture="MSIL" location="Packages/Bonsai.Dsp.2.8.1/lib/net462/Bonsai.Dsp.dll" />
<AssemblyLocation assemblyName="Bonsai.Editor" processorArchitecture="MSIL" location="Packages/Bonsai.Editor.2.8.5/lib/net472/Bonsai.Editor.dll" />
<AssemblyLocation assemblyName="Bonsai.Osc" processorArchitecture="MSIL" location="Packages/Bonsai.Osc.2.7.0/lib/net462/Bonsai.Osc.dll" />
<AssemblyLocation assemblyName="Bonsai.Scripting.Expressions" processorArchitecture="MSIL" location="Packages/Bonsai.Scripting.Expressions.2.8.0/lib/net462/Bonsai.Scripting.Expressions.dll" />
Expand Down
13 changes: 7 additions & 6 deletions articles/getting-started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ uid: getting-started
title: Getting Started
---

Welcome to the user guide! The next few pages are dedicated to users who are unfamiliar with ONIX
and Bonsai, and will teach them what ONIX is, how to download and install Bonsai, open a new file,
place operators (and understand what an operator is), reorder a workflow, run a workflow, and
finally visualize data.
Welcome to the user guide! The next few pages are for users to learn how to use ONIX hardware using the OpenEphys.Onix1
Bonsai package. Browse the articles in the table of contents to learn more.

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>.
This software documentation is intended to be used hand-in-hand with the
[Hardware documentation](https://open-ephys.github.io/onix-docs/index.html) to learn about and start using their ONIX hardware.

For those who are looking for user guides and example workflows for using a particular device or headstage in Bonsai, visit
the <xref:hardware>.
21 changes: 21 additions & 0 deletions articles/getting-started/reference.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
uid: reference
title: Software Reference
---

The following table provides information about which operators correspond to which hardware and the "Shift" and "Scale"
values to convert the ADC value to μV. For more information, refer to the
[Basic Ephys Data Processing in Bonsai](xref:basic-ephys-processing).

| Hardware | Configuration Operator | Ephys Device | Ephys Data Operator | Data Frame | Shift | Scale |
|----------------------------------|-------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------|-----------------------------------------------|----------------------------------------------------|--------|--------------------|
| Headstage64 | <xref:OpenEphys.Onix1.ConfigureHeadstage64> | [Intan Rhd2164 (amplifier channels)](https://intantech.com/files/Intan_RHD2164_datasheet.pdf) | <xref:OpenEphys.Onix1.Rhd2164Data> | <xref:OpenEphys.Onix1.Rhd2164DataFrame> | -32768 | 0.195 |
| HeadstageRhs2116 | <xref:OpenEphys.Onix1.ConfigureHeadstageRhs2116> | [Intan Rhs2116](https://intantech.com/files/Intan_RHS2116_datasheet.pdf) | <xref:OpenEphys.Onix1.Rhs2116Data> | <xref:OpenEphys.Onix1.Rhs2116DataFrame> | -32768 | 0.195 |
| NeuropixelsV1e<wbr>Headstage | <xref:OpenEphys.Onix1.ConfigureNeuropixelsV1eHeadstage> | [Neuropixels 1.0 probe (AP)](https://www.neuropixels.org/_files/ugd/328966_c5e4d31e8a974962b5eb8ec975408c9f.pdf) | <xref:OpenEphys.Onix1.NeuropixelsV1eData> | <xref:OpenEphys.Onix1.NeuropixelsV1DataFrame> | -512 | $1.2e6/1024/gain$* |
| NeuropixelsV2e<wbr>Headstage | <xref:OpenEphys.Onix1.ConfigureNeuropixelsV2eHeadstage> | [Neuropixels 2.0 probe](https://www.neuropixels.org/_files/ugd/328966_2b39661f072d405b8d284c3c73588bc6.pdf) | <xref:OpenEphys.Onix1.NeuropixelsV2eData> | <xref:OpenEphys.Onix1.NeuropixelsV2eDataFrame> | -2048 | 3.05176 |
| NeuropixelsV2eBeta<wbr>Headstage | <xref:OpenEphys.Onix1.ConfigureNeuropixelsV2eBetaHeadstage> | Neuropixels 2.0 Beta probe | <xref:OpenEphys.Onix1.NeuropixelsV2eBetaData> | <xref:OpenEphys.Onix1.NeuropixelsV2eBetaDataFrame> | -8192 | 0.7629 |

\* The Neuropixels 1.0 probes have selectable gain which has an effect on the multiplier for scaling the signal to μV,
so the $1.2e6/1024/gain$ formula must be used to calculate the correct "Scale" value. The Gain is set by the user in the
[Configuration GUI](xref:np1e_gui) of that headstage.

78 changes: 74 additions & 4 deletions articles/getting-started/visualize-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,79 @@ uid: visualize-data
title: Visualize Data
---

To visualize data from any `*Data` operator, typically the variable that needs to be visualized must first be output from the operator. To do this, right-click on any `*Data` operator and select the first option; this will be something similar to `Output (OpenEphys.Onix1.*DataFrame)`. From the drop-down list, select the corresponding data variable to be visualized. Doing so will create a new operator in the workflow.
Bonsai has ["type visualizers"](https://bonsai-rx.org/docs/articles/editor.html?#type-visualizers) that display data
produced by an operator. They are opened by double-clicking the corresponding node while the workflow is running.

Select this new operator and right-click it, search for the **Select Visualizer** option and choose a visualizer from that drop-down menu. Note that some data types will require a secondary operator to be connected directly after it, such as a `RollingGraph` operator. If so, this secondary operator must be right-clicked and the appropriate visualizer must be selected here.
Read below for more details about how to visualize data.

> [!Note]
> Some visualizers come as Bonsai operators and can be found in the `Bonsai.Design.Visualizers` package, which can be installed in the Bonsai package manager. These operators must be placed in the workflow and be linked to a data operator to visualize the data properly.
## Selecting operator data members for visualization

Some operators, such as [ONIX data I/O operators](xref:dataio), require selecting members from their output to visualize
their data:
1. Right-click the node that corresponds to the data I/O operator you'd like to visualize.
1. Hover the cursor over the "Output" option that appears in the context menu.
1. Click the member you would like to visualize from the list of members.

This populates the workflow with a <xref:Bonsai.Expressions.MemberSelectorBuilder> operator that selects the single
member from the data frame produced by the data I/O operator.

<video controls>
<source src="../../images/select-member.mp4" type="video/mp4">
</video>

> [!NOTE]
> Member selection is required when an operator's output type doesn't have type visualizers that allow users to inspect
> the data in a meaningful capacity. This is true for [ONIX data I/O operators](xref:dataio) which typically produce
> [data frames](xref:data-elements).

## Selecting visualizers

Select the visualizer you would like to use for visualizing data:
1. Right-click the `MemberSelector` node labelled with the member you would like to visualize.
1. Hover the cursor over the "Select Visualizer" option in the context menu.
1. Click the visualizer you would like to use from the list of visualizers.

<video controls>
<source src="../../images/set-visualizer.mp4" type="video/mp4">
</video>

## Opening visualizers

Open the visualizer and check:
1. Start the workflow.
1. If the desired visualizer is closed, double-click the `MemberSelector` node labelled with the member you would
like to visualize.
1. Visualize the data.

> [!NOTE]
> Data will only be visualized if the operator is producing data. If you can't see any data, check that:
> - The device from which you are trying to read is enabled.
> - Events are occurring. Some devices are stream-based and some are event-based. Event-based devices only produce data upon certain
> events. For example, the <xref:OpenEphys.Onix1.DigitalInput> operator only produces data when the digital
> port status changes state.

> [!TIP]
> Visualizers can be selected while the workflow is running which is helpful for more quickly trying different visualizer
> options in succession if you are unsure about which one you want to use.

## Configuring visualizers
Some visualizers, in particular those that involve plots, allow additional configuration.
Right-click the visualizer window to gain access to configuration options.

For example, the MatVisualizer allows configuration of:
- X and Y scale: click to toggle between "auto" and fixed values.
- Channel view: click the grid square to toggle between superimposed or separate
- History Length: click the arrow and configure the number of samples displayed in the plot.
- Display Previous: click the arrow and configure the amount of buffers displayed in the plot.
- Channel Offset: click the arrow and configure the Y offset.
- Channels per Page: click the arrow and configure the amount of channels displayed per visualizer page. The page number is displayed at the top of the visualizer. Move between pages by using the PageUp and PageDn keys on the keyboard.

<video controls>
<source src="../../images/visualize-data.mp4" type="video/mp4">
</video>

> [!TIP]
> For other data visualization options, additional visualizers are available as standalone operators and can be found in
> the `Bonsai.Design.Visualizers` package. These visualizer operators must be connected to an operator that produces a
> sequence of compatible data. The visualizer window can be opened by double-clicking the visualizer node instead of the
> preceding data node.
3 changes: 2 additions & 1 deletion articles/hardware/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ 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 and example workflows for the ONIX breakout board, headstages, and other compatible
hardware that are supported by the library.
1 change: 1 addition & 0 deletions articles/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- href: getting-started/initialize-oni-context.md
- href: getting-started/start-workflow.md
- href: getting-started/visualize-data.md
- href: getting-started/reference.md

- name: Hardware Guides
href: hardware/index.md
Expand Down
Loading