-
Notifications
You must be signed in to change notification settings - Fork 4
Add documentation with DocFX #6
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
Merged
glopesdev
merged 15 commits into
bonsai-rx:main
from
FeeLab:5-add-documentation-with-docfx
Nov 20, 2025
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
d7a0b87
Add minimal Docfx documentation
J-M-White 460519b
Update docs/apidoc/Bonsai_SpikeGLX_TriggerRecording.md
J-M-White e5200eb
Add consistent naming in Trigger-Recording example workflow
J-M-White bd37a4f
Use backticks (`) to highlight all package names.
J-M-White 22dd640
Update link to the remote command server page in the SpikeGLX manual.
J-M-White 650a83c
Improve documentation
J-M-White a14b53a
Improve documentation
J-M-White baa6417
Merge branch '5-add-documentation-with-docfx' of https://github.com/F…
J-M-White b419222
Add example workflow for DigitalOutput
J-M-White b94b1eb
Slight formatting changes for consistency
glopesdev 58e0607
Add package README file
glopesdev 29435ce
Remove unused actions
glopesdev aadb38d
Merge pull request #1 from glopesdev/documentation-review
J-M-White 4e53719
Delete favicon.ico and logo.svg
J-M-White 6270bfe
Clean up documentation
J-M-White File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,48 +1,17 @@ | ||
| # Bonsai.SpikeGLX | ||
| [Bonsai](http://bonsai-rx.org/) package for interfacing with [SpikeGLX](https://billkarsh.github.io/SpikeGLX/). | ||
| # Bonsai - SpikeGLX | ||
| `Bonsai.SpikeGLX` is a [Bonsai](https://bonsai-rx.org/) package for interfacing with the [SpikeGLX](https://billkarsh.github.io/SpikeGLX/) recording software for [Neuropixels](https://www.neuropixels.org/) probes. | ||
|
|
||
| ## Description | ||
| Bonsai.SpikeGLX is designed to allow integration of SpikeGLX recordings into Bonsai workflows. This package provides the ability to | ||
| - stream neural and non-neural data from SpikeGLX into Bonsai in real-time, | ||
| - set digital outputs on an NI device in use by SpikeGLX, and | ||
| - start and stop SpikeGLX recordings. | ||
|
|
||
| ## Getting Started | ||
| ### Starting the SpikeGLX Remote Command Server | ||
| Bonsai.SpikeGLX requires SpikeGLX's remote command server to be running. See the [SpikeGLX-CPP-SDK Getting Started](https://github.com/billkarsh/SpikeGLX-CPP-SDK/blob/main/GettingStarted.txt) page for how to do this. Each Bonsai.SpikeGLX marble requires the IP address and port of the SpikeGLX command server to work. | ||
|
|
||
| ### Streaming SpikeGLX Data into Bonsai | ||
| Bonsai.SpikeGLX provides two ways to access data from SpikeGLX once an acquisition is running: | ||
| - **SpikeFetch** will fetch a fixed-size buffer of the latest data from SpikeGLX whenever it receives an input signal (or at a fixed interval if no input is provided). | ||
| - **SpikeStream** will continuously stream data in fixed-size buffers from SpikeGLX. | ||
|
|
||
| The key difference between the two is that unlike SpikeFetch, SpikeStream will never skip or repeat elements in the buffers it emits. This is demonstrated below, where both marbles have been used to stream a 1Hz sinewave in 1s buffers. The output of SpikeFetch 'jumps' around as it misses or repeats samples, whereas the output of SpikeStream does not. | ||
|
|
||
|  | ||
|
|
||
| ### Setting Digital Outputs | ||
| The **DigitalOutput** marble may be used to control digital outputs on an NI DAQ system in use by SpikeGLX. | ||
|
|
||
| ### Controlling SpikeGLX Recordings | ||
| SpikeGLX recordings may be started and stopped using the **TriggerRecording** marble, which can increment/decrement the gate and trigger values in SpikeGLX. It takes a tuple of two integers, which modify the gate and trigger, respectively, in the following way: | ||
| - -1: No change | ||
| - 0: Set low | ||
| - 1: Increment and set high | ||
|
|
||
| As of SpikeGLX Release v20230815-phase30, adding a fixed period of saved data before and after triggering for context is not implemented for remote triggering. An alternative is to use TTL controlled start and stop, with a digital output (controlled using the **DigitalOutput** marble) as the TTL signal. | ||
| `Bonsai.SpikeGLX` is designed to allow integration of SpikeGLX recordings into Bonsai workflows. This package provides the ability to: | ||
| - stream neural and non-neural data from SpikeGLX into Bonsai in real-time; | ||
| - set digital outputs on an NI device in use by SpikeGLX; and | ||
| - start and stop SpikeGLX recordings. | ||
|
|
||
| ## Authors | ||
| Bonsai.SpikeGLX is developed by Jacob White of the [Fee Lab](https://feelaboratory.org/) at MIT. | ||
|
|
||
| ## Version History | ||
| -0.1 | ||
| - Initial Release | ||
| `Bonsai.SpikeGLX` was initially developed by Jacob White of the [Fee Lab](https://feelaboratory.org/) at MIT. | ||
|
|
||
| ## License | ||
| Use is subject to [MIT](https://opensource.org/license/mit/) license terms. | ||
| `Bonsai.SpikeGLX` is released as open source under the [MIT License](https://licenses.nuget.org/MIT). | ||
|
|
||
| SpikeGLX-CPP-SDK components are subject to [Janelia Research Campus Software Copyright 1.2 license](http://license.janelia.org/license) terms. | ||
|
|
||
| ## Acknowledgments | ||
| The SpikeStream marble is inspired by the AudioCapture marble in [Bonsai.Audio](https://github.com/bonsai-rx/bonsai/tree/main/Bonsai.Audio). | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| uid: Bonsai.SpikeGLX.DigitalOutput | ||
| --- | ||
|
|
||
| [!include[DigitalOutput](~/articles/spikeglx-digitaloutput.md)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| uid: Bonsai.SpikeGLX.Fetch | ||
| --- | ||
|
|
||
| [!include[Fetch](~/articles/spikeglx-fetch.md)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| uid: Bonsai.SpikeGLX.Trigger | ||
| --- | ||
|
|
||
| > [!WARNING] | ||
| > [`Trigger`](xref:Bonsai.SpikeGLX.Trigger) works only with SpikeGLX runs configured to use **remote controlled start and stop** triggering. | ||
| [!include[Trigger](~/articles/spikeglx-trigger.md)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| # Getting Started | ||
| `Bonsai.SpikeGLX` is a [Bonsai](https://bonsai-rx.org/) package for interfacing with the [SpikeGLX](https://billkarsh.github.io/SpikeGLX/) recording software for [Neuropixels](https://www.neuropixels.org/). | ||
|
|
||
| It is designed to supplement the core functionalities of SpikeGLX (*i.e.*, visualizing and saving data) and facilitate more complex experimental paradigms (*e.g.*, closed-loop neurofeedback, brain-computer interfaces, *etc.*). | ||
|
|
||
| `Bonsai.SpikeGLX` provides three ways of interacting with an ongoing SpikeGLX run: | ||
| - streaming data from SpikeGLX into Bonsai with [`Fetch`]; | ||
| - controlling SpikeGLX digital output lines with [`DigitalOutput`]; and | ||
| - starting and stopping recordings with [`Trigger`]. | ||
|
|
||
| A brief summary of the functionality of each of these operators is provided here. A more detailed description of each may be found on the associated Reference page. | ||
|
|
||
| > [!NOTE] | ||
| > All `Bonsai.SpikeGLX` operators require SpikeGLX's remote command server to be running. A full description of how to do this can be found in the [SpikeGLX User Manual](https://billkarsh.github.io/SpikeGLX/Sgl_help/UserManual.html#remote-command-servers). Make sure to note the `Host` (IP Address) and `Port` the command server is listening on. These are properties that must be set for each `Bonsai.SpikeGLX` operator. | ||
|
|
||
| ## Stream Data from SpikeGLX | ||
| [!include[Fetch](~/articles/spikeglx-fetch.md)] | ||
|
|
||
| ## Control Digital Outputs | ||
| [!include[DigitalOutput](~/articles/spikeglx-digitaloutput.md)] | ||
|
|
||
| ## Save Data | ||
| SpikeGLX is expressly designed for saving Neuropixels data. As a result, it is recommended to use SpikeGLX's built-in capabilities to save your data; however, `Bonsai.SpikeGLX` provides ways to control which parts of a run SpikeGLX should save. If a SpikeGLX run is configured to use "remote controlled start and stop" triggering, [`Trigger`] may be used to set gate and trigger values. | ||
|
|
||
| [!include[Trigger](~/articles/spikeglx-trigger.md)] | ||
|
|
||
| > [!NOTE] | ||
| > SpikeGLX also provides the ability to trigger recordings using a TTL line. In some cases, this may be preferred over using [`Trigger`]. | ||
|
|
||
| If you do wish to save data you have streamed into Bonsai using [`Fetch`], you can use the [`MatrixWriter`] operator from the `Bonsai.Dsp` package. | ||
|
|
||
| <!--Reference Style Links --> | ||
| [`Fetch`]: xref:Bonsai.SpikeGLX.Fetch | ||
| [`DigitalOutput`]: xref:Bonsai.SpikeGLX.DigitalOutput | ||
| [`Trigger`]: xref:Bonsai.SpikeGLX.Trigger | ||
| [`Timer`]: xref:Bonsai.Reactive.Timer | ||
| [`MatrixWriter`]: xref:Bonsai.Dsp.MatrixWriter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| --- | ||
| uid: spikeglx-digitaloutput | ||
| title: DigitalOutput | ||
| --- | ||
|
|
||
| [`DigitalOutput`] writes a logical value to one or more digital output lines on a NI-DAQ device in use by SpikeGLX. Digital lines are specified in the `Channels` property as a comma separated list, (*e.g.*, `Dev6/port0/line2,Dev6/port0/line5`). | ||
|
|
||
| For example, the below workflow toggles a digital line between high and low every second. | ||
| :::workflow | ||
|  | ||
| ::: | ||
|
|
||
| > [!WARNING] | ||
| > Unlike `Bonsai.DAQmx`'s [`DigitalOutput`](xref:Bonsai.DAQmx.DigitalOutput), `Bonsai.SpikeGLX`'s [`DigitalOutput`] writes **the same** logical value to all of its channels. | ||
|
|
||
| <!--Reference Style Links --> | ||
| [`DigitalOutput`]: xref:Bonsai.SpikeGLX.DigitalOutput | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| --- | ||
| uid: spikeglx-fetch | ||
| title: Fetch | ||
| --- | ||
|
|
||
| [`Fetch`] samples data from an ongoing SpikeGLX run. Data are sampled from one or more channels of a single SpikeGLX data stream. Data are emitted in a sample buffer, where each row corresponds to a channel, and each column to a sample from each of the channels. The order of the channels follows the order in which you specify the channels in the `Channels` property. | ||
|
|
||
| If no input source is specified, data is emitted asynchronously every time a new buffer is filled. | ||
| :::workflow | ||
|  | ||
| ::: | ||
|
|
||
| Alternatively, if an input observable sequence is provided, a new data buffer is emitted every time a new notification is emitted by the input source. | ||
| :::workflow | ||
|  | ||
| ::: | ||
|
|
||
| <!--Reference Style Links --> | ||
| [`Fetch`]: xref:Bonsai.SpikeGLX.Fetch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| --- | ||
| uid: spikeglx-trigger | ||
| title: Trigger | ||
| --- | ||
|
|
||
| [`Trigger`] takes as input a `Tuple` of two values, which modify the gate and trigger, respectively, in the following way: | ||
| - -1: No change | ||
| - 0: Set low | ||
| - 1: Increment and set high | ||
|
|
||
| For example, the below workflow starts a new gate immediately, and then toggles the trigger every five seconds. This results in SpikeGLX saving five-second periods of the run every ten seconds. | ||
| :::workflow | ||
|  | ||
| ::: | ||
|
|
||
| <!--Reference Style Links --> | ||
| [`Trigger`]: xref:Bonsai.SpikeGLX.Trigger |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| - name: Introduction | ||
| href: ../index.md | ||
| - name: Getting Started | ||
| href: getting-started.md |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,3 +2,4 @@ apiRules: | |
| - exclude: | ||
| hasAttribute: | ||
| uid: System.ObsoleteAttribute | ||
|
|
||
J-M-White marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1 @@ | ||
| --- | ||
| _layout: landing | ||
| --- | ||
|
|
||
| [!INCLUDE [](README.md)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,4 @@ | ||
| - name: Manual | ||
| href: articles/ | ||
| - name: API | ||
| href: ../artifacts/docs/api/ |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.