Importing epochs (matlab format) through script: how to set epoch and baseline time interval?

Hi,

I am succesfully importing (averaged) epochs from matlab (.mat files), except that I am unable to set their time interval (should be from -0.1 to 0.2 s) nor their baseline interval (-0.1 to 0 s); sampling rate is 512Hz. My script is:

sFiles = bst_process('CallProcess', 'process_import_data_epoch', sFiles, , ...
'subjectname', SubjectNames{suj}, ...
'condition', 'AraFix', ...
'datafile', {{RawFiles{suj}}, 'EEG-MAT'}, ...
'iepochs', , ...
'eventtypes', '', ...
'createcond', 0, ...
'channelalign', 1, ...
'usectfcomp', 1, ...
'usessp', 1, ...
freq', , ...
'baseline', );

Probably the two bottom lines are the key, but I have tried several inputs, such as

    'freq',         512, ...
    'baseline',     [-0.1, 0]);

and in all cases epochs look like this (no baseline, temporal scale as if sampling rate was 1000Hz):

Thanks in advance for any clue to solve this.
Luis

Provisionally (but I understand this is not the ideal solution), I am solving this issue by subsequently opening each of the data files within the brainstorm_db folder containing my protocol (also through a script) and changing the 'Time' array you find within them (btw, I am also changing 'nAvg' -number of trials from which each averaged epoch proceeds, necessary for weighted averages-, which I have neither found how to set in the script above.

The sampling frequency and baseline duration are defined with the Brainstorm property ImportEegRawOptions. If you import the .mat files interactively, it asks all the parameters below. If you change them, the new values are saved, and used as default the next time you import a file interactively, or non-interactively with the process process_import_data_epoch.m.

image

If you need to change these values from a script:

OPTIONS = bst_get('ImportEegRawOptions');
OPTIONS.BaselineDuration = 0.1;
bst_set('ImportEegRawOptions', OPTIONS);

The option baseline refers to the DC offset removal from the interactive import interface, and the option freq is not used in this case.

https://neuroimage.usc.edu/brainstorm/Tutorials/Epoching#Import_in_database

Thanks a lot for both responses, Francois