Writing Scripts

Getting started with scripting in BrainVoyager (JavaScript)

Start with scripting in BrainVoyager

The Scripting Getting Started Guide for BrainVoyager provides tutorials and practical examples, for instance how to perform preprocessing of multiple projects via scripting or to read and write a text file. Some basic programming examples like `variables', `arrays' and `loops' are explained in appendices of the chapters.

The guide and example scripts from the guide can be downloaded via the links below:

Getting Started Guide for scripting in BrainVoyager (BrainVoyager 21.4) 

Latest update: 19-09-2019

Scripts from the Scripting Getting Started Guide (*.zip)

Front cover:

GSGScriptingCoverBV214

Please note that it is also possible to write scripts using the Visual Scripting Editor (since summer 2017).

Scripting BrainVoyager from Matlab via COM

To use BrainVoyager's scripting functions from Matlab, the following document is available:

 
Manual
 

Table of contents

1 Introduction
2 Creating documents
3 Preprocessing functional data
4 Transformations
5 Experimental design
6 Statistical analysis
7 Surface meshes
8 Using NeuroElf

 
Scripts
(containing bvprotocol_to_bvdesignmatrix.m, coregister_fmr_vmr_create_vtc.m, create_cgobjects_protocol.m, create_fmr_document.m, create_mtc_file.m, create_multiple_vtcs.m, create_multistudy_designmatrix.m, create_vmrdocument_via_interface.m, CreateVMRTransformToTALandMNI.m, diffusion_weighted_data.m, intra_session_alignment.m, isovoxel_vmr.m, meshes.m, MeshLoading.m, MeshMTCSingleStudyGLM.m, preprocess_fmr.m, preprocess_vtc.m)
 
 
ScriptingBV2221FromMatlabFront

 

Note: the LoadVOIFile() function temporarily does not work in BV22.2; the issue is fixed since BrainVoyager 23.2. The equivalent function in Python load_vois() works fine.

Writing Scripts for BrainVoyager in Python
Documentation The documentation can be opened via the BrainVoyager menu > Py... more
Scripting reference for BrainVoyager (JavaScript)

Scripting users guide for BrainVoyager:

Scripting Reference for BrainVoyager 23 (February 2024)

This guide contains the following chapters:
1. Introduction 
2. The BrainVoyager Script Editor
3. BrainVoyager Scripting Commands (API)
4. Creating scripts with dialogs
5. JavaScript language reference

Scripting reference for BrainVoyager 22.2.1 (October 2021)

Notes for different BrainVoyager versions:

  • CorrectMotion() is described as using trilinear interpolation, but in some versions of BrainVoyager uses SINC interpolation (f.e. BV20.2; in BV20.4 it is Trilinear-SINC). The text will be changed in the next version of the Reference. To be certain about the type of interpolation, use CorrectMotionEx().
  • If the temporal high-pass filter is applied via the graphical user interface of BrainVoyager, the resulting filename ('*THPGLM*') does not contain 'LTR', while via scripting, it does. However, when comparing the files (binary), they are the same.

Note for BrainVoyager 20.4: The description for CreateVTCInMNISpace() in the Reference Manual distributed with the BrainVoyager installer contains one argument too many (the ACPC trf file). For the correct version, see the Manual above.

Note for BrainVoyager 20: There seems to be an issue with the function AutoTransformToIsovoxel(). This has been reported and is awaiting a fix. Also, the combination of Windows 10 and BrainVoyager 20 seems to give problems for scripting of motion correction. This is caused by the default movie handler on Windows 10 trying to open the motion correction movie. A temporary solution could be to use CorrectMotionEx() and set the movie parameter to 'false' (parameter 5). With thanks to Tobias Meissner.   .

For a guide to start with scripting in BrainVoyager, please refer to page Guide to start with (Java)scripting.