Category: Research Tools

  • Bonsai as a Visual Programming Language

    Bonsai as a Visual Programming Language

    Bonsai is a visual programming language introduced in a 2015 paper.
    It lets you acquire data from sensors and process it at the same time.

    One of Bonsai’s strengths is that you can build complex processing pipelines much like assembling a puzzle, and then check the results of that processing in real time.

    Bonsai can also be combined with other analysis software (DeepLabCut, Open Ephys, BonVision, and so on) and with hardware (cameras, controllers, microcontrollers, etc.), which makes it highly extensible.

    Because you can perform complex analysis and processing intuitively without having to learn a seemingly daunting programming language, anyone can use it easily, and it broadens the range of experiments you can run.

    The paper on Bonsai is available here.
    You can install Bonsai from here.

    Image taken from the paper.
    Each circle is called a node and represents an individual processing step.

    This is what the screen looks like when Bonsai is actually running (taken from the paper).
    On the left you can search for nodes and add the one you want; in the center you arrange nodes to build your pipeline while visualizing how it works; and on the right are the detailed settings for each node.

    The pop-up windows on the main screen show the execution status of each node — for a camera capture node, for example, it can display the live camera image.

    It may look difficult at first glance, but seen this way it turns out to be surprisingly simple.

    Now let’s actually install it.
    That said, all you have to do is download it from this site.
    Just open the downloaded “Bonsai-*.*.*.exe” file and run the installer.
    Note that security software such as Virus Buster may sometimes prevent the installation.

    Once Bonsai is installed, both Bonsai and Bonsai (x86) will appear in your list of applications.
    Either one is fine for normal use, but occasionally one of them will not run; when that happens, trying the other one often works.

    One drawback is that Bonsai currently runs only on Windows and does not support Linux or macOS.
    Support may come in the future, but this is something to keep in mind.

    From next time, I’ll start actually using Bonsai.