properties and methods

Properties and methods

A method is an instruction to execute a command. A method can be identified by the ( ), for example BVQX.CreateProjectFMR().

Parameters that should be passed to a method, can be entered between the parentheses: object.method( parameter ).

In the case VMRdoc.SpatialGaussianSmoothing("4", "mm"), the parameters "4" en "mm" are passed to the method SpatialGaussianSmoothing().

 

A property is a characteristic of an object, for example BVQX.name.

Properties can be changed via the '=' sign. The variable and its property that needs to be changed are on the left side of the argument, and the new value can be given on the right side: object.property = newValue; For example, when the repetition time of the FMR project needs to be set, this can be done via:

 

docFMR.TR = 2000;

 

Like shown in the examples, the properties and methods cannot be set or executed on their own. Properties and methods always belong to an object, like above, the 'docFMR' object or 'BVQX', the application object. The object and its property or method are separated by a period ('.').

 

In BrainVoyager QX scripting, the most important agents are the BrainVoyager application object and the BrainVoyager project (document object).

To let the scripting editor execute commands, the requests should be addressed to the application object or to the BrainVoyager project.

Use of colors in the Script Editor

The BrainVoyager methods and properties are shown in dark blue, for example BVQX.CreateProjectFMR(). The so-called keywords in QSA are also dark blue and bold, like function and var. The in-built language (QSA) functions appear in black.

String values, characterized by " ", are shown in green: "CG_OBJECTS.fmr".

Constant values have the colour maroon, f.e. the boolean constants true or false, or the constants undefined and NaN (not a number).

Numbers appear in bright blue, for example var xResolution = 256;