Skip to content
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
23 changes: 23 additions & 0 deletions ALL_IMAGES_FIX_NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# All-images stimulus fix

This patch addresses two independent failure modes:

1. `CloseCycle` is a custom Bonsai extension, so a fresh checkout must build `Extensions.dll`
before running Bonsai. The repo ignores `bin`, `obj`, and `*.dll`, so these artifacts are not
present after a fresh `git clone`/checkout.

2. The stimulus selection branch previously used:

EnumerateFiles -> Variation(Count=8) -> LoadImages -> SelectedImages

For an experiment intended to use all available images in `stimuli/images_A`, this branch should
not randomly select a subset before loading images. The workflow is changed to:

EnumerateFiles -> LoadImages -> SelectedImages

The downstream branch still randomizes presentation order:

SelectedImages -> Permutation -> CloseCycle -> task sequence

Run `build_extensions.cmd` after each fresh checkout, or run `run_detection_of_change.cmd`, which
builds the extension and then launches the workflow from the `src` folder.
18 changes: 18 additions & 0 deletions build_extensions.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@echo off
setlocal

cd /d "%~dp0"

echo Building Bonsai Extensions...
dotnet build "src\Extensions.csproj" -c Release
if errorlevel 1 (
echo.
echo Build failed. Do not run the experiment until this succeeds.
exit /b 1
)

copy /Y "src\bin\Release\net472\Extensions.dll" "src\Extensions.dll"
copy /Y "src\bin\Release\net472\Extensions.dll" "bonsai\Extensions.dll"

echo.
echo Extensions.dll built and copied successfully.
10 changes: 10 additions & 0 deletions run_detection_of_change.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@echo off
setlocal

cd /d "%~dp0"

call build_extensions.cmd
if errorlevel 1 exit /b 1

cd /d "%~dp0src"
"..\bonsai\Bonsai.exe" "DetectionOfChange_with_template_and_mpe_comp.bonsai"
6 changes: 2 additions & 4 deletions src/DetectionOfChange_with_template_and_mpe_comp.bonsai
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<WorkflowBuilder Version="2.9.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:rx="clr-namespace:Bonsai.Reactive;assembly=Bonsai.Core"
Expand Down Expand Up @@ -2202,9 +2202,7 @@
<Edge From="53" To="54" Label="Source2" />
<Edge From="54" To="55" Label="Source1" />
<Edge From="56" To="57" Label="Source1" />
<Edge From="57" To="59" Label="Source1" />
<Edge From="58" To="59" Label="Source2" />
<Edge From="59" To="60" Label="Source1" />
<Edge From="57" To="60" Label="Source1" />
<Edge From="60" To="61" Label="Source1" />
<Edge From="61" To="62" Label="Source1" />
<Edge From="62" To="63" Label="Source1" />
Expand Down