Skip to content
Open
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
10 changes: 5 additions & 5 deletions src/Extensions/BehaviorVisualizer.bonsai
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<WorkflowBuilder Version="2.9.0"
<WorkflowBuilder Version="2.9.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:rx="clr-namespace:Bonsai.Reactive;assembly=Bonsai.Core"
xmlns:imgui="clr-namespace:Bonsai.ImGui;assembly=Bonsai.ImGui"
Expand Down Expand Up @@ -239,7 +239,7 @@
<scr:Expression>new(it.Item1 as LickLeft, it.Item2)</scr:Expression>
</Expression>
<Expression xsi:type="imviz:RollingBufferBuilder">
<imviz:Capacity>1000</imviz:Capacity>
<imviz:Capacity>10000</imviz:Capacity>
<imviz:IndexSelector>Item2</imviz:IndexSelector>
<imviz:ValueSelector>LickLeft</imviz:ValueSelector>
</Expression>
Expand Down Expand Up @@ -289,7 +289,7 @@
<scr:Expression>new(it.Item1 as LickRight, it.Item2)</scr:Expression>
</Expression>
<Expression xsi:type="imviz:RollingBufferBuilder">
<imviz:Capacity>1000</imviz:Capacity>
<imviz:Capacity>10000</imviz:Capacity>
<imviz:IndexSelector>Item2</imviz:IndexSelector>
<imviz:ValueSelector>LickRight</imviz:ValueSelector>
</Expression>
Expand Down Expand Up @@ -418,7 +418,7 @@
<scr:Expression>new(it.Seconds, it.Value as Choice)</scr:Expression>
</Expression>
<Expression xsi:type="imviz:RollingBufferBuilder">
<imviz:Capacity>1000</imviz:Capacity>
<imviz:Capacity>10000</imviz:Capacity>
<imviz:IndexSelector>Seconds</imviz:IndexSelector>
<imviz:ValueSelector>Choice</imviz:ValueSelector>
</Expression>
Expand Down Expand Up @@ -510,7 +510,7 @@
<scr:Expression>new(it.Seconds, it.Value as Choice)</scr:Expression>
</Expression>
<Expression xsi:type="imviz:RollingBufferBuilder">
<imviz:Capacity>1000</imviz:Capacity>
<imviz:Capacity>10000</imviz:Capacity>
<imviz:IndexSelector>Seconds</imviz:IndexSelector>
<imviz:ValueSelector>Choice</imviz:ValueSelector>
</Expression>
Expand Down
13 changes: 3 additions & 10 deletions src/Extensions/BiasVisualizer.bonsai
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<WorkflowBuilder Version="2.9.0"
<WorkflowBuilder Version="2.9.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:rx="clr-namespace:Bonsai.Reactive;assembly=Bonsai.Core"
xmlns:implot="clr-namespace:Bonsai.ImPlot;assembly=Bonsai.ImPlot"
Expand Down Expand Up @@ -34,7 +34,7 @@
</implot:Size>
<implot:Flags>NoTitle</implot:Flags>
<implot:FlagsX>AutoFit</implot:FlagsX>
<implot:FlagsY>None</implot:FlagsY>
<implot:FlagsY>Invert</implot:FlagsY>
</Expression>
<Expression xsi:type="rx:PublishSubject">
<Name>BiasPlot</Name>
Expand All @@ -50,8 +50,8 @@
<p1:double>1</p1:double>
</p1:TickPositions>
<p1:TickLabels>
<p1:string>R</p1:string>
<p1:string>L</p1:string>
<p1:string>R</p1:string>
</p1:TickLabels>
<p1:ImPlotLocationFlags>East</p1:ImPlotLocationFlags>
<p1:ImPlotLegendFlags>Outside</p1:ImPlotLegendFlags>
Expand Down Expand Up @@ -324,12 +324,6 @@
<imviz:Visible>true</imviz:Visible>
<imviz:Flags>None</imviz:Flags>
</Expression>
<Expression xsi:type="SubscribeSubject">
<Name>TaskLogicParameters</Name>
</Expression>
<Expression xsi:type="MemberSelector">
<Selector>TrialGenerator</Selector>
</Expression>
</Nodes>
<Edges>
<Edge From="0" To="1" Label="Source1" />
Expand Down Expand Up @@ -397,7 +391,6 @@
<Edge From="61" To="62" Label="Source1" />
<Edge From="62" To="63" Label="Source1" />
<Edge From="63" To="64" Label="Source1" />
<Edge From="65" To="66" Label="Source1" />
</Edges>
</Workflow>
</Expression>
Expand Down
30 changes: 23 additions & 7 deletions src/Extensions/MetadataVisualizer.bonsai
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<WorkflowBuilder Version="2.9.0"
<WorkflowBuilder Version="2.9.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:rx="clr-namespace:Bonsai.Reactive;assembly=Bonsai.Core"
xmlns:imgui="clr-namespace:Bonsai.ImGui;assembly=Bonsai.ImGui"
Expand Down Expand Up @@ -246,6 +246,19 @@
<Expression xsi:type="imgui:TableNextColumnBuilder">
<imgui:Visible>true</imgui:Visible>
</Expression>
<Expression xsi:type="SubscribeSubject">
<Name>StartExperimentShortcut</Name>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="BooleanProperty">
<Value>false</Value>
</Combinator>
</Expression>
<Expression xsi:type="PropertyMapping">
<PropertyMappings>
<Property Name="Enabled" />
</PropertyMappings>
</Expression>
<Expression xsi:type="p1:EnableableButtonBuilder">
<p1:Name>StartButton</p1:Name>
<p1:Visible>true</p1:Visible>
Expand Down Expand Up @@ -323,14 +336,17 @@
<Edge From="37" To="38" Label="Source2" />
<Edge From="39" To="40" Label="Source1" />
<Edge From="40" To="41" Label="Source1" />
<Edge From="40" To="46" Label="Source1" />
<Edge From="41" To="42" Label="Source1" />
<Edge From="40" To="49" Label="Source1" />
<Edge From="41" To="45" Label="Source1" />
<Edge From="42" To="43" Label="Source1" />
<Edge From="43" To="45" Label="Source1" />
<Edge From="43" To="44" Label="Source1" />
<Edge From="44" To="45" Label="Source2" />
<Edge From="46" To="47" Label="Source1" />
<Edge From="47" To="48" Label="Source1" />
<Edge From="48" To="49" Label="Source1" />
<Edge From="45" To="46" Label="Source1" />
<Edge From="46" To="48" Label="Source1" />
<Edge From="47" To="48" Label="Source2" />
<Edge From="49" To="50" Label="Source1" />
<Edge From="50" To="51" Label="Source1" />
<Edge From="51" To="52" Label="Source1" />
</Edges>
</Workflow>
</Expression>
Expand Down
25 changes: 16 additions & 9 deletions src/Extensions/OperationControl.bonsai
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<WorkflowBuilder Version="2.9.0"
<WorkflowBuilder Version="2.9.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:rx="clr-namespace:Bonsai.Reactive;assembly=Bonsai.Core"
xmlns:p1="clr-namespace:AllenNeuralDynamics.LicketySplit;assembly=AllenNeuralDynamics.LicketySplit"
Expand Down Expand Up @@ -1079,6 +1079,9 @@
<Expression xsi:type="Combinator">
<Combinator xsi:type="rx:Merge" />
</Expression>
<Expression xsi:type="rx:BehaviorSubject">
<Name>SpoutDelta</Name>
</Expression>
<Expression xsi:type="rx:Condition">
<Name>Drop0s</Name>
<Workflow>
Expand Down Expand Up @@ -1139,6 +1142,9 @@
<Expression xsi:type="rx:BehaviorSubject">
<Name>ManipulatorBiasTracker</Name>
</Expression>
<Expression xsi:type="SubscribeSubject">
<Name>SpoutDelta</Name>
</Expression>
<Expression xsi:type="SubscribeSubject">
<Name>ManipulatorPosition</Name>
</Expression>
Expand Down Expand Up @@ -1210,18 +1216,19 @@
<Edge From="34" To="36" Label="Source1" />
<Edge From="35" To="36" Label="Source2" />
<Edge From="36" To="37" Label="Source1" />
<Edge From="37" To="39" Label="Source1" />
<Edge From="38" To="39" Label="Source2" />
<Edge From="39" To="40" Label="Source1" />
<Edge From="40" To="43" Label="Source1" />
<Edge From="41" To="42" Label="Source1" />
<Edge From="42" To="43" Label="Source2" />
<Edge From="37" To="38" Label="Source1" />
<Edge From="38" To="40" Label="Source1" />
<Edge From="39" To="40" Label="Source2" />
<Edge From="40" To="41" Label="Source1" />
<Edge From="42" To="45" Label="Source1" />
<Edge From="43" To="44" Label="Source1" />
<Edge From="44" To="45" Label="Source1" />
<Edge From="44" To="45" Label="Source2" />
<Edge From="45" To="46" Label="Source1" />
<Edge From="46" To="47" Label="Source1" />
<Edge From="47" To="48" Label="Source1" />
<Edge From="48" To="49" Label="Source1" />
<Edge From="49" To="50" Label="Source1" />
<Edge From="50" To="51" Label="Source1" />
<Edge From="51" To="52" Label="Source1" />
</Edges>
</Workflow>
</Expression>
Expand Down
38 changes: 19 additions & 19 deletions src/Extensions/Visualizers.bonsai
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<WorkflowBuilder Version="2.9.0"
<WorkflowBuilder Version="2.9.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:imvizui="clr-namespace:Bonsai.ImGui.Visualizers;assembly=Bonsai.ImGui.Visualizers.Design"
xmlns:imgui="clr-namespace:Bonsai.ImGui;assembly=Bonsai.ImGui"
Expand Down Expand Up @@ -458,7 +458,7 @@
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="p4:ManipulatorPosition">
<p4:X>-1</p4:X>
<p4:X>1</p4:X>
<p4:Y1>0</p4:Y1>
<p4:Y2>0</p4:Y2>
<p4:Z>0</p4:Z>
Expand Down Expand Up @@ -498,7 +498,7 @@
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="p4:ManipulatorPosition">
<p4:X>1</p4:X>
Comment thread
bruno-f-cruz marked this conversation as resolved.
<p4:X>-1</p4:X>
<p4:Y1>0</p4:Y1>
<p4:Y2>0</p4:Y2>
<p4:Z>0</p4:Z>
Expand Down Expand Up @@ -539,8 +539,8 @@
<Expression xsi:type="Combinator">
<Combinator xsi:type="p4:ManipulatorPosition">
<p4:X>0</p4:X>
<p4:Y1>1</p4:Y1>
<p4:Y2>0</p4:Y2>
<p4:Y1>0</p4:Y1>
<p4:Y2>1</p4:Y2>
<p4:Z>0</p4:Z>
</Combinator>
</Expression>
Expand Down Expand Up @@ -579,8 +579,8 @@
<Expression xsi:type="Combinator">
<Combinator xsi:type="p4:ManipulatorPosition">
<p4:X>0</p4:X>
<p4:Y1>0</p4:Y1>
<p4:Y2>1</p4:Y2>
<p4:Y1>1</p4:Y1>
<p4:Y2>0</p4:Y2>
<p4:Z>0</p4:Z>
</Combinator>
</Expression>
Expand Down Expand Up @@ -619,8 +619,8 @@
<Expression xsi:type="Combinator">
<Combinator xsi:type="p4:ManipulatorPosition">
<p4:X>0</p4:X>
<p4:Y1>-1</p4:Y1>
<p4:Y2>0</p4:Y2>
<p4:Y1>0</p4:Y1>
<p4:Y2>-1</p4:Y2>
<p4:Z>0</p4:Z>
</Combinator>
</Expression>
Expand Down Expand Up @@ -659,8 +659,8 @@
<Expression xsi:type="Combinator">
<Combinator xsi:type="p4:ManipulatorPosition">
<p4:X>0</p4:X>
<p4:Y1>0</p4:Y1>
<p4:Y2>-1</p4:Y2>
<p4:Y1>-1</p4:Y1>
<p4:Y2>0</p4:Y2>
<p4:Z>0</p4:Z>
</Combinator>
</Expression>
Expand Down Expand Up @@ -889,11 +889,6 @@
<Expression xsi:type="MemberSelector">
<Selector>Item2</Selector>
</Expression>
<Expression xsi:type="Multiply">
<Operand xsi:type="DoubleProperty">
<Value>-1</Value>
</Operand>
</Expression>
<Expression xsi:type="MulticastSubject">
<Name>ManualSpoutDelta</Name>
</Expression>
Expand All @@ -905,7 +900,6 @@
<Edge From="2" To="3" Label="Source1" />
<Edge From="3" To="4" Label="Source1" />
<Edge From="4" To="5" Label="Source1" />
<Edge From="5" To="6" Label="Source1" />
</Edges>
</Workflow>
</Expression>
Expand All @@ -928,6 +922,11 @@
<Expression xsi:type="MemberSelector">
<Selector>Item2</Selector>
</Expression>
<Expression xsi:type="Multiply">
<Operand xsi:type="DoubleProperty">
<Value>-1</Value>
</Operand>
</Expression>
<Expression xsi:type="MulticastSubject">
<Name>ManualSpoutDelta</Name>
</Expression>
Expand All @@ -939,6 +938,7 @@
<Edge From="2" To="3" Label="Source1" />
<Edge From="3" To="4" Label="Source1" />
<Edge From="4" To="5" Label="Source1" />
<Edge From="5" To="6" Label="Source1" />
</Edges>
</Workflow>
</Expression>
Expand Down Expand Up @@ -2032,13 +2032,13 @@
<CameraName>BodyCamera</CameraName>
<MinSaturation>0.1</MinSaturation>
<MaxSaturation>0.9</MaxSaturation>
<FlipState>2</FlipState>
<FlipState>1</FlipState>
<Rotation>0</Rotation>
<TriggeredCamerasStream>TriggeredCamerasStream</TriggeredCamerasStream>
</Expression>
<Expression xsi:type="IncludeWorkflow" Path="Extensions\CameraPreviewVisualizer.bonsai">
<FrameSubject>Camera</FrameSubject>
<CameraName>BodyCamera</CameraName>
<CameraName>SideCamera</CameraName>
<MinSaturation>0.1</MinSaturation>
<MaxSaturation>0.9</MaxSaturation>
<FlipState>2</FlipState>
Expand Down
2 changes: 1 addition & 1 deletion src/main.bonsai

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Visualizers node should be encapsulated in a Defer to make sure we dont leak the inner scope.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing with individual visualizers, if at all possible, make them defers to make the workflow easier to reason about.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<WorkflowBuilder Version="2.9.0"
<WorkflowBuilder Version="2.9.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p1="clr-namespace:AindDynamicForagingDataSchema;assembly=Extensions"
xmlns:rx="clr-namespace:Bonsai.Reactive;assembly=Bonsai.Core"
Expand Down