-
Notifications
You must be signed in to change notification settings - Fork 4
Documentation for GPO trigger and stimulator reports #289
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
Open
cjsha
wants to merge
4
commits into
issue-272
Choose a base branch
from
issue-286-287
base: issue-272
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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
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,43 @@ | ||
| --- | ||
| uid: hs64_gpo-trigger | ||
| title: Headstage 64 GPO Trigger | ||
| --- | ||
|
|
||
| The following excerpt from the Headstage 64 [example | ||
| workflow](xref:hs64_workflow) demonstrates triggering a stimulus following a | ||
| press of the X key on the breakout board. The GPO trigger toggles a pin on the | ||
| headstage to trigger stimulus more instantaneously than writing to a register | ||
| which is how other Headstage 64 operators trigger stimulus. | ||
|
|
||
| > [!NOTE] | ||
| > If you want to use the GPO trigger to only trigger electrical stimulus, the | ||
| > electrical stimulator should be the only stimulator device armed on the | ||
| > headstage. If you want to use the GPO trigger to only trigger optical | ||
| > stimulus, the optical stimulator should be the only stimulator device armed on | ||
| > the headstage. | ||
bparks13 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ::: workflow | ||
|  | ||
| ::: | ||
|
|
||
| [!INCLUDE [<digital-io-info>](<../../../includes/breakout-digital-io.md>)] | ||
|
|
||
| <xref:OpenEphys.Onix1.BreakoutButtonState> is selected from the | ||
| `DigitalInputDataFrame`. It is an enumerator with values that correspond to bit | ||
| positions of the breakout board's digital port. When this type is connected to a | ||
| `HasFlags` operator, the enumerated values appear in the `HasFlags`'s `Value` | ||
| property's dropdown menu. Because `HasFlags`'s `Value` is set to "Square", its | ||
cjsha marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| output is "True" when the selected `BreakoutButtonState` bit field contains the | ||
| "Square" flag. The <xref:Bonsai.Reactive.DistinctUntilChanged> operator only | ||
| allows passes an item in its input sequence if it's different from the previous | ||
| item in the input sequence. The <xref:Bonsai.Reactive.Condition> operator only | ||
| passes an item in its input sequence if `Condition`'s internal logic | ||
| is "True". In this case, `Condition` has no internal logic (which can | ||
| be inspected by selecting the node and pressing <kbd>Ctrl+Enter</kbd>), so it | ||
| uses the value of the Boolean in its input sequence to decide whether or not to | ||
| pass a value. | ||
|
|
||
| When the <xref:OpenEphys.Onix1.Headstage64ElectricalStimulatorTrigger> operator | ||
| receives a "True" value in its input sequence, a stimulus waveform is triggered. | ||
| The waveform can be modified by editing the | ||
| `Headstage64ElectricalStimulatorTrig` operator's properties. | ||
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 |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| --- | ||
| uid: hs64_stimulator-data | ||
| title: Headstage 64 Stimulator Data | ||
| --- | ||
|
|
||
| The following excerpt from the Headstage 64 [example | ||
| workflow](xref:hs64_workflow) demonstrates how to save the waveform parameters | ||
| and the hardware timestamp of every stimulus delivered as described in the | ||
| <xref:hs64_estim>, <xref:hs64_ostim>, and <xref:hs64_gpo-trigger> articles. | ||
|
|
||
| ::: workflow | ||
|  | ||
| ::: | ||
|
|
||
| The <xref:OpenEphys.Onix1.Headstage64ElectricalStimulatorData> operator | ||
| generates a sequence of | ||
| [Headstage64ElectricalStimulatorDataFrames](xref:OpenEphys.Onix1.Headstage64ElectricalStimulatorDataFrame) | ||
| which contain data about when an electrical stimulus was delivered and the | ||
| corresponding electrical stimulation waveform. A frame is emitted when an | ||
| electrical stimulus is delivered. In the Headstage 64 example workflow, the | ||
| `Headstage64ElectricalStimulatorData`'s `DeviceName` property is set to | ||
bparks13 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "Headstage64/Headstage64ElectricalStimulator". This links the | ||
| `Headstage64ElectricalStimulatorData` operator to the corresponding | ||
| configuration operator. Frames from this operators are saved to a file named | ||
| "estim_.csv" using a <xref:Bonsai.IO.CsvWriter>. | ||
cjsha marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| The <xref:OpenEphys.Onix1.Headstage64OpticalStimulatorData> operator generates a | ||
| sequence of | ||
| [Headstage64OpticalStimulatorDataFrames](xref:OpenEphys.Onix1.Headstage64OpticalStimulatorDataFrame) | ||
| which contain data about when an optical stimulus was delivered and the | ||
| corresponding optical stimulation waveform. A frame is emitted when an optical | ||
| stimulus is delivered. In the Headstage 64 example workflow, the | ||
| `Headstage64OpticalStimulatorData`'s `DeviceName` property is set to | ||
| "Headstage64/Headstage64OpticalStimulator". This links the | ||
| `Headstage64OpticalStimulatorData` operator to the corresponding configuration | ||
| operator. Frames from this operators are saved to a file named "ostim_.csv" | ||
| using a `CsvWriter`. | ||
|
|
||
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
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,8 @@ | ||
| The <xref:OpenEphys.Onix1.DigitalInput> operator generates a sequence of | ||
| [DigitalInputDataFrames](xref:OpenEphys.Onix1.DigitalInputDataFrame). Although | ||
| the digital inputs are sampled at 4 Mhz, these data frames are only emitted when | ||
| the port status changes (i.e., when a pin, button, or switch is toggled) when | ||
| `DigitalInput`'s `SampleRate` property is left blank such as is done in the | ||
| example workflow. The `DigitalInput`'s `DeviceName` property is set to | ||
| "BreakoutBoard/DigitalInput". This links the `DigitalInput` operator to the | ||
| corresponding configuration operator. |
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 |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <WorkflowBuilder Version="2.9.0" | ||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xmlns:onix1="clr-namespace:OpenEphys.Onix1;assembly=OpenEphys.Onix1" | ||
| xmlns:rx="clr-namespace:Bonsai.Reactive;assembly=Bonsai.Core" | ||
| xmlns="https://bonsai-rx.org/2018/workflow"> | ||
| <Workflow> | ||
| <Nodes> | ||
| <Expression xsi:type="Combinator"> | ||
| <Combinator xsi:type="onix1:DigitalInput"> | ||
| <onix1:DeviceName>BreakoutBoard/DigitalIO</onix1:DeviceName> | ||
| </Combinator> | ||
| </Expression> | ||
| <Expression xsi:type="MemberSelector"> | ||
| <Selector>Buttons</Selector> | ||
| </Expression> | ||
| <Expression xsi:type="HasFlag"> | ||
| <Operand xsi:type="WorkflowProperty" TypeArguments="onix1:BreakoutButtonState"> | ||
| <Value>Square</Value> | ||
| </Operand> | ||
| </Expression> | ||
| <Expression xsi:type="Combinator"> | ||
| <Combinator xsi:type="rx:DistinctUntilChanged" /> | ||
| </Expression> | ||
| <Expression xsi:type="rx:Condition"> | ||
| <Workflow> | ||
| <Nodes> | ||
| <Expression xsi:type="WorkflowInput"> | ||
| <Name>Source1</Name> | ||
| </Expression> | ||
| <Expression xsi:type="WorkflowOutput" /> | ||
| </Nodes> | ||
| <Edges> | ||
| <Edge From="0" To="1" Label="Source1" /> | ||
| </Edges> | ||
| </Workflow> | ||
| </Expression> | ||
| <Expression xsi:type="Combinator"> | ||
| <Combinator xsi:type="onix1:Headstage64GpoTrigger"> | ||
| <onix1:DeviceName>Headstage64/Headstage64PortController</onix1:DeviceName> | ||
| </Combinator> | ||
| </Expression> | ||
| </Nodes> | ||
| <Edges> | ||
| <Edge From="0" To="1" Label="Source1" /> | ||
| <Edge From="1" To="2" Label="Source1" /> | ||
| <Edge From="2" To="3" Label="Source1" /> | ||
| <Edge From="3" To="4" Label="Source1" /> | ||
| <Edge From="4" To="5" Label="Source1" /> | ||
| </Edges> | ||
| </Workflow> | ||
| </WorkflowBuilder> |
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.