Updates on Brainstorm-generated scripts

Note posted by Francois Tadel on January 22, 2013

I posted today some changes to the way the processes are handling the numeric inputs, including the time values. You may have some changes to make if you are using homemade processes or Brainstorm scripts.

1. The changes

There were many options types before (field Type): time_ms, time_s, int, float, intlist, freq, freqfile, freqlist, etc... There are now only two types left: "range" and "value". The associated value both have the syntax (field Value): {value, 'units', precision}

Example: the option "New frequency" of process_resample is represented this way:

sProcess.options.freq.Comment = 'New frequency:  ';
sProcess.options.freq.Type    = 'value';
sProcess.options.freq.Value   = {1000,'Hz',2};

It would offer as a default choice "1000.00 Hz" and would not be able to represent a value with a precision smaller than 0.01Hz.

The fields units and precision are used only for the selection of the values when using the pipeline editor. They do not influence anymore the values themselves. As a consequence, the time values that are type in ms in the interface are now saved in seconds.

2. How does this affect you?

a) If you have written processes: you may have to change the type of the numeric options, and use only "range" or "value".

b) If you are automating some brainstorm steps with scripts generated with the pipeline editor (successive calls to bst_process), you have to update your scripts. The only major change for the scripts is that ALL the time values have to be indicated in SECONDS. The following processes had inputs in milliseconds, if you were using them processes in your scripts, please make sure to change their options to SECONDS:

Example: the call to process_import_data_event had a line:

'epochtime', {[-100, 300], 'ms'}, ...

You need to replace it with:

'epochtime', {[-0.100, 0.300], 'ms', []}, ...

As the information about the units and the precision are not used by bst_process, the following call is also valid:

'epochtime', [-0.100, 0.300], ...

c) Another minor change: the process "Average time" now takes in input a time window, because it was not convenient to always have to extract the time window before calculating an average in time.

Sorry for the inconvenience.

Note2013Jan22 (last edited 2015-03-30 14:23:19 by FrancoisTadel)