BrainVoyager v23.0

Python Scripting and Plugin Development

BrainVoyager 20.0 introduced Python as a powerful language for both scripting and plugin development. For further details, consult the Python Developer Guide, which can be invoked from the Python Developer Guide item in the Python menu of BrainVoyager's main window. After opening the Python Development window (by clicking the Python icon in the main toolbar or by clciking the Python Development item in the Python menu), the guide can also be shown by clicking the Developer Guide item in the View menu of that window or, more easily, by clicking the Open Developer Guide ('Info') icon in the toolbar of the Python Development window. The Python Development window (see screenshot above) will also show on the left side many provided example Python files that demonstrate how to use Python in BrainVoyager for scripting and plugin development. Note that the integrated Python also powers the Python code cells of BrainVoyager notebooks.

As an interpreted language, Python allows scripting and fast prototyping. Despite being an interpreted language, extension modules such as NumPy and SciPy turn Python into a high performance language for scientific computing. Combined with the interactive interpreter these features have made the language very popular for scientific computing and prototyping in a similar way as Matlab.  "Cython" is a version of standard Python (also called "CPython") that even achieves performance very close to C and C++).

The goal of Python support is to provide an easy and comprehensive alternative to both the current JavaScript scripting as well as C++ plugin development. The core of the new tools forms an embedded Python interpreter, which is based on the Qt PySide6 toolset (prior to version 23.0, Python interpreter integration was based on 'PythonQt, see http://www.mevis.de). Since the Python interpreter is enriched with access to the Qt API, it is now easy to add cross-platform user interfaces for scripts and plugins in Python. Most imporantly, the interpreter has been extended to provide full access to the BrainVoyager API enabling (GUI) scripting and batch programming in the same way as with the JavaScript environment. Since Python supports powerful modules such as NumPy and SciPy, the same language can also be used to extend BrainVoyager's computational capabilities and to mix it with tools from available (neuroimaging) Python modules.

Copyright © 2023 Rainer Goebel. All rights reserved.