Introduction to Bonsai
Materials for the V4SDB Student Winter School Bonsai introduction and tutorial
31.01.2025 - 11:30 - 13:00
Instructor:
Adriana Nagy-Dăbâcan (Transylvanian Institute of Neuroscience)
dabacan@tins.ro
See Github link here.
Workshop Overview
During the session, we will present Bonsai as a reactive programming tool usefull when designing and analyzing behavioral experiments. We will go through the potential applications for Bonsai and its most relevant usecases. Then, we will get familiar with this tool by implementing a simple workflow combining animal tracking with closed loop control. We will showcase basic programming principles and will open the door for addressing more complex needs in experimental design.
By the end of the workshop, participants will be familiar with Bonsai as a tool for behavioral experimental control and will understand its basic principles of operation. They will have a good source of documentation and will be able to join the community for further support.
Software
- An open-source visual reactive programming software for interactive systems.
- built to work with .NET framework in Windows 7 or later.
- for Linux installation, see pointers here.
Prepare the field
- Download and install Bonsai.
- Install the Starter Pack from the Package Manager.
- Check out the Bonsai Gallery and make sure the example workflows work on your station.
- Download the video file for this workshop.
Workshop step-by-step
- Open and visualize video file.
- Detect animal using simple image processing functions.
- Compute centroid coordinates in arena.
- Implement simple conditionals using Logical operators.
- Integrate python scripting for more complex logics.
- Trigger some digital line/speaker when animal leaves predetermined home area.
Bonsai Resources
References
Lopes, G., Bonacchi, N., Frazão, J., Neto, J. P., Atallah, B. V., Soares, S., … & Kampff, A. R. (2015). Bonsai: an event-based framework for processing and controlling data streams. *Frontiers in Neuroinformatics**, 9, 7. https://doi.org/10.3389/fninf.2015.00007