This repository stores Bonsai code to run visual stimuli that are part of this community effort: Neural mechanisms of predictive processing.

Organization

All Bonsai workflows should go into the code/stimulus-control/src folder, along with the Extensions folder.

Deployment

Initial Setup (Important!)

  1. To deploy the Bonsai code, run code/stimulus-control/bonsai/setup.cmd.
    This small script will download and regenerate the current Bonsai environment (see tutorial for further details).

  2. CRITICAL: Only use the Bonsai.exe that is downloaded by the setup script. This ensures that you're using the correct version with all required packages.

  3. The script will create a local Bonsai installation in the code/stimulus-control/bonsai folder
  4. Launch Bonsai by double-clicking the Bonsai.exe within this folder, not from any other installation on your system

  5. The setup script will automatically install all required packages specified in the Bonsai.config file. Do not manually install additional packages unless absolutely necessary.

Avoiding Common Issues

  • Version conflicts: Using multiple versions of Bonsai on the same system can lead to package conflicts. Always use the version downloaded by the setup script.

Troubleshooting

If you encounter issues: 1. Close all instances of Bonsai 2. Delete the file in code/stimulus-control/bonsai that are not present on the GitHub repository. 3. Run the setup.cmd script again to get a fresh installation 4. Open your workflow using the newly downloaded Bonsai.exe

Updating Dependencies

Each time you change a project dependency via the Package Manager, the Bonsai.Config file will be updated, and you can choose to commit these changes. However, take care when adding new packages as this might create dependencies that others will need to install.


Prerequisites

These should only need to be installed once on a fresh new system and are not required if simply refreshing the install or deploying to a new folder.

Hardware Specific:

These are needed to run Bonsai workflows on the Allen Institute rigs with HARP devices: - FTDI CDM Driver 2.12.28 (serial port drivers for HARP devices) - Spinnaker SDK 1.29.0.5 (device drivers for FLIR cameras) - On the FLIR website: Download > Archive > 1.29.0.5 > SpinnakerSDK_FULL_1.29.0.5_x64.exe - NI-DAQmx 19.0 (drivers for NI-DAQ devices)