Skip to content

Commit a52e9e5

Browse files
committed
Address jon's PR feedback
Additionally: - Add some images - Fix typos
1 parent c6e21cf commit a52e9e5

File tree

7 files changed

+35
-32
lines changed

7 files changed

+35
-32
lines changed

articles/tutorials/ephys-socket.md

Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Visualizing Data in the Open Ephys GUI
44
---
55

66
This tutorial shows how to stream ephys data from Bonsai the Open Ephys
7-
GUIthrough an intermediary TCP connection. This approach lets users take
7+
GUI through an intermediary TCP connection. This approach lets users take
88
advantage of both the extensibility of Bonsai and specialized visualizers
99
available in the Open Ephys GUI such as the Probe Viewer which is specifically
1010
designed for very dense arrays like Neuropixels probes. By the end of this
@@ -13,24 +13,16 @@ NeuropixelsV1e headstage (384 channels of LFP band and AP band data) and an Open
1313
Ephys GUI signal chain that receives and visualizes the two data streams in the
1414
Open Ephys GUI:
1515

16-
![screenshot of socket signal chain viewport](../../images/ephys-socket-tut/socket-viewport.webp)
17-
18-
Click <a href="../../workflows/tutorials/ephys-socket/sockets-signal-chain" download>here</a> to
19-
download the signal chain that corresponds to the above graph.
16+
![screenshot of final result from following tutorial](../../images/ephys-socket-tut/sockets-end-result.webp)
2017

2118
> [!NOTE]
22-
> This tutorial uses NeuropixelsV1e Headstage as an example, but the process is
23-
> similar for other ephys headstages. In fact, this tutorial can be used to send
24-
> data from any Bonsai operator that produces an applies to any data source that
25-
> produces matrices (`OpenCV.NET.Mat`s).
26-
>
27-
> This tutorial assumes you are familiar with the [hardware
28-
> guide](xref:hardware) of the ONIX headstage you intend to use. Use the
29-
> information on the <xref:data-elements> reference page to know which shift and
30-
> scaling you need to use for each device on other headstages.
31-
>
32-
> A [video summary](#video-summary) of this tutorial is is available at the
33-
> bottom of this page.
19+
> - This tutorial uses NeuropixelsV1e Headstage as an example, but the process is
20+
> similar for other ephys headstages. In fact, this tutorial can be used to send
21+
> data from any Bonsai operator that produces [matrices](xref:OpenCV.Net.Mat).
22+
> - This tutorial assumes you are familiar with the [hardware guide](xref:hardware)
23+
> of the ONIX headstage you intend to use.
24+
> - A [video summary](#video-summary) of this tutorial is is available at the
25+
> bottom of this page.
3426
3527
## Transmit Ephys Data to a TCP Server in Bonsai
3628

@@ -39,8 +31,8 @@ familiarize yourself with Bonsai. In particular, [download the necessary Bonsai
3931
packages](xref:install-configure-bonsai#package-installation) or [check for
4032
updates](xref:install-configure-bonsai#update-packages) if they're already
4133
installed. Once you've done that, copy/paste the following workflow into your
42-
Bonsai editor. The following sections explain how to configure each element of
43-
this workflow
34+
Bonsai editor. The following sections explain how to create this workflow and
35+
configure its elements.
4436

4537
::: workflow
4638
![SVG of copyable functional workflow](../../workflows/tutorials/ephys-socket/ephys-socket.bonsai)
@@ -54,12 +46,11 @@ set their properties:
5446
![Screenshot of TCPServer configuration in Bonsai](../../images/ephys-socket-tut/tcp-server-config.png)
5547

5648
- **Address**: Use "localhost" if you are running Bonsai and the Open Ephys GUI
57-
on the same machine or the IP address of the machine running the GUI if not.
58-
- **Name**: give the TCP server a unique name. We will use this name to provide
59-
later in the workflow to send data though the connections established by this
60-
server. In this example, we have named them "SpikeServer" and "LfpServer".
61-
These names are arbitrary, but in our example they correspond to the kind of
62-
data they will transmit.
49+
on the same machine. Use the IP address of the machine running the GUI if not.
50+
- **Name**: give the TCP server a unique name. This name is used later in the
51+
the workflow to specify to which server to send data. In this example, we have
52+
named them "SpikeServer" and "LfpServer". These names are arbitrary, but in
53+
our example they correspond to the kind of data they will transmit.
6354
- **Port**: choose a unique [port
6455
number](https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers). We
6556
will use this port number to establish the connection with the Open Ephys GUI.
@@ -127,17 +118,17 @@ streams. This operator comes from the OpenEphys.Sockets Bonsai package.
127118
![SVG of workflow that creates TCP sockets, configures hardware, & streams data over sockets](../../workflows/tutorials/ephys-socket/ephys-socket.bonsai)
128119
:::
129120

130-
Configure the "Connection" property of each `SendMatOverSocket` operator to each
131-
of the TCP Socket names configured earlier. In this example, we used
132-
"SpikeServer" for "SpikeData" and "LfpServer" for "LfPData".
121+
Set the "Connection" property of each `SendMatOverSocket` operator to the name
122+
of a TCP Socket configured earlier. In this example, "SpikeServer" is used
123+
for "SpikeData" and "LfpServer" for "LfPData".
133124

134125
> [!TIP]
135126
> Although the Open Ephys GUI has recording functionality, data acquired using
136127
> the Bonsai.Onix1 package should be written to disk in Bonsai because it is
137-
> possible for data to be lost if e.g. the TCP Buffer overflows. You can learn
128+
> possible for data to be lost e.g. if the TCP Buffer overflows. You can learn
138129
> to do this by following the [Hardware Guides](xref:hardware) for your
139-
> particular hardware. For this example, if you are using the NeuropixelsV1e
140-
> Headstage like the example, follow the [NeuropixelsV1e Headstage Hardware
130+
> particular hardware. For example, if you are using the NeuropixelsV1e
131+
> Headstage like the example, you would follow the [NeuropixelsV1e Headstage Hardware
141132
> Guide](xref:np1e).
142133
143134
## Receive ONIX Data from Socket in Open Ephys GUI
@@ -156,6 +147,12 @@ get familiarized with the Open Ephys GUI. In particular:
156147
[General plugin
157148
features](https://open-ephys.github.io/gui-docs/User-Manual/Plugins/index.html#general-plugin-features)
158149

150+
Once you've done that, <a href="../../workflows/tutorials/ephys-socket/sockets-signal-chain" download>download</a>
151+
the following signal chain and load it into the GUI. The following sections explain how to
152+
create this signal chain and configure its elements.
153+
154+
![cropped screenshot of sockets signal chains A & B](../../images/ephys-socket-tut/sockets-signal-chain.webp)
155+
159156
### Configure processors to visualize spike data
160157

161158
Drag the source processor `Ephys Socket` from the Processor list and drop it
@@ -164,7 +161,7 @@ onto the Signal Chain area, followed by the sink processor `Probe Viewer`.
164161
Ephys data in the Open Ephys GUI is represented using floating point values in units
165162
of microvolts. Data coming from Bonsai will need to be converted to microvolts in
166163
order to plot properly within the GUI. To do this, the `Ephys Socket` processor
167-
provides the "Scale" and "Offset" values.:
164+
provides the "Scale" and "Offset" values:
168165

169166
$Output\, (uV)= Scale * (Input - Offset)$
170167

@@ -176,6 +173,12 @@ In this tutorial we used the following values:
176173
- **Offset**: 512. The NeuropixelsV1e device outputs offset-binary
177174
encoded signed 10-bit data, so 512 corresponds to 0 volts.
178175

176+
> [!TIP]
177+
> Use the information on the <xref:data-elements> reference page to know which
178+
> shift and scaling values you need to use for each device on other headstages. For
179+
> example, you can find these values for the Neuropixels 1.0 device
180+
> [here](xref:OpenEphys.Onix1.NeuropixelsV1DataFrame):
181+
179182
After configuring `Ephys Socket` processor, press the "Connect" button to
180183
establish a connection with the `LfpServer` running in Bonsai.
181184

Binary file not shown.
Binary file not shown.

img-src/port-9001-signal-chain.xcf

15 Bytes
Binary file not shown.

img-src/port-9002-signal-chain.xcf

10 Bytes
Binary file not shown.

img-src/sockets-end-result.xcf

1.86 MB
Binary file not shown.

img-src/sockets-signal-chain.xcf

74.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)