BrainVoyager v23.0

Scripting and Automation

Writing and running cross-platform scripts within BrainVoyager provides an important possibility to simplify analysis of large multi-subject data sets removing the need to use the mouse and keyboard to run the same preprocessing and analysis steps again and again. While script programs may reduce also the amount of user errors, it is nonetheless important to check the validity of the performed analysis steps (see also section Quality Assurance Tools). To learn about JavaScript scripting in BrainVoyager please consult the Scripting Getting Started Guide and Scripting Reference Manual that have been installed in the "GettingStartedGuides" directory within the BrainVoyager folder. On Windows, shortcuts will be also available directly from the "Program Files" menu in the folder "BrainVoyager". Since BrainVoyager 20 it is also possible to use the Python language for scripting.

Many years ago, BrainVoyager introduced an important extension to the provided scripting (and plugin) system that allows to create and use cross-platform graphical user interface (GUI) components for scripts, which could also serve as nice cross-platform frontents for plugins (see topic Writing GUI Scripts in the Plugins Developer Guide). In BrainVoyager 23.0 a new scripting and user interface development layer has been implemented, which became necessary due to the upgrade to version 6 of the Qt Framework that is used by BrainVoyager. The adaptation of old JavaScript (JS) scripts to the new scripts is very easy since the old and new scripting language are both based on (slightly different versions of) JavaScript. It is also possible to call BrainVoyager commands in the same way as before. The development of GUI scripts, however, requires some work since the old ".ui" files need to be replaced by ".qml" files that define user interface components in a modern declarative way. Consult the Scripting Reference Manual to learn how to move to the new scripting system. BrainVoyager 23.0 substantially enhanced the build-in development tools to create JS scripts and QML-based user interfaces (see screenshot above). For more details, consult the next topic: The QML / JS Script Development Window.

While running scripts within BrainVoyager is what one often wants, there might be working scenarios that would benefit from the possibility to run scripts from outside the program. On Windows, this is made possible by the COM (Component Object Model) binaray interface. On Windows, BrainVoyager is running as a COM server allowing all programs and scripts supporting the COM interface to remotely access BrainVoyager's functionality. Since Matlab supports the COM interface, it can be used to script BrainVoyager. This might be particularly useful for power users who want to mix custom analysis routines written in Matlab with the processing and visualization capabilities of BranVoyager. For details, see the Scripting BrainVoyager from Matlab guide that has been installed in the "GettingStartedGuides" directory within the 'Documents/BrainVoyager' folder. Other "COM aware" environments can also be used to automate BrainVoyager, including external script programs written in Visual Basic or JScript.



Copyright © 2023 Rainer Goebel. All rights reserved.