[FieldTrip] BVA preprocessed data importing

tuba aktürk aktrktuba at gmail.com
Tue Feb 22 07:09:08 CET 2022

Dear all,

I have a question about brain vision preprocessed EEG data importing to the

Normally, I was using the below code for it, which worked perfectly so many
times. But, with the newest versions of the Fieldtrip I am getting the
warning: "Warning: endsample is before begsample, returning empty data",
and it ends up with the trial structure where only the last trial is read
and the previous ones appear blank... I searched blogs and Fieldtrip
mailing list, however, didn't find any topic on that problem. I am sharing
the script I am using below. If you have any suggestions or ideas I would
be very grateful. Thanks!

path = 'C:\Vision\Analyzer2\export\';

% Subject Lists
subjs = {'t01' 't02' 't03' 't04' 't05'};

% Condition Lists
cond = {'Segmentation_-1500_1500_aud_post'

for i=1:length(subjs)
    for k=1:length(cond)
        cfg                 = [];
        cfg.trialfun        = 'ft_trialfun_brainvision_segmented';
        cfg.continuous      = 'no';
        cfg.demean          = 'yes';
        cfg.baselinewindow  = [-200 0];
        cfg.dataset         = [path subjs{i} cond{k} '.eeg'];
        cfg.headerfile      = [path subjs{i} cond{k} '.vhdr'];

        cfg = ft_definetrial(cfg);

        if k == 1
            subj(i).aud_post = ft_preprocessing (cfg);
        elseif k == 2
            subj(i).aud_pre = ft_preprocessing (cfg);


Best regards,

*Tuba Aktürk*

*PhD StudentCognitive Neuroscience, Psychology and Neuroscience, Maastricht
University **&*
*Neuroscience, Graduate School of Health Science, Istanbul Medipol
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20220222/3e9012f8/attachment.htm>

More information about the fieldtrip mailing list