[FieldTrip] Exporting preprocessed data from BVA to Fieldtrip

Elsa Sangaran elsangaran at gmail.com
Fri Sep 17 15:16:28 CEST 2021


Dear all,

I am having some trouble with the exported data (averages of different
conditions in my experiment) which I preprocessed on Brain Vision Analyzer. I
used the generic data export option on BVA, which generated 3 files (.seg,
.vhdr, .vmrk), which I then imported to Fieldtrip. When reading in the
exported data, I get the following error messages and warnings:

Script:

for subj = (name_subj)

    % (re)set directory to the directory that contains the trialfun

    subject = subj{:};





seg_file =[dir_raw_data_external subject '.seg'];
%Subject's .seg file, ie. 'pilot1.seg'

header_file =[dir_raw_data_external subject '.vhdr'];
%Subject's .vhdr file, ie. 'pilot1.vhdr'



cfg = [];

cfg.dataset = seg_file;

hdr = ft_read_header(header_file);

nTrials = hdr.nSamples/trial_length;

hdr.nTrials = nTrials;

hdr.nSamples = trial_length;

dat = ft_read_data(seg_file,'header', hdr);

cfg.label = channel_labels;

cfg.trial = squeeze(num2cell(dat,[1 2]))';

cfg.hdr = hdr;

cfg.time =
repmat({[time_start:(time_end-time_start)/trial_length:time_end-(time_end-time_start)/trial_length]},1,nTrials);

cfg.label = cfg.hdr.label;

cfg.trialinfo = [];

cfg.sampleinfo = [0 300];

cfg.fsample = 250;

data_raw = cfg;



% make variables for header and eeg file

%    headerfile   = [dir_raw_data_external subject '.vhdr'];

%     segfile     = [dir_raw_data_external subject '.seg'];

%

%     cfg = [];

%     cfg.headerfile = headerfile;

%     cfg.dataset = segfile;

%     data_raw = ft_preprocessing(cfg);

%



%cfg.trialdef.eventtype  = 'string'

%cfg.trialdef.eventvalue = number, string or list with numbers or strings





   cfg = [];

   cfg.trialdef.prestim    = 0.2;

  cfg.trialdef.poststim   = 1;

  cfg.trialdef.eventtype  = 'Time 0';

    cfg.trialdef.eventvalue = '';

  cfg.trialdef.triallength = 1.2;

    cfg.trialdef.ntrials     = 1;



   cfg.headerfile  = header_file;

   cfg.datafile    = seg_file;

        cfg_deftrial = ft_definetrial(cfg);

         data_segmented = ft_redefinetrial(cfg_deftrial, data_raw);

end


For ft_definetrial, I get the following warnings:


   - Warning: could not determine dimord of "dataset"
   - Warning: inconsistent sampleinfo
   - Warning: inconsistent trialinfo

For ft_redefinetrial, I get the following warnings:


   - Warning: the data does not contain sampleinfo
   - Warning: reconstructing sampleinfo by assuming that the trials are
   consecutive segments of a continuous recording

I appreciate your advice and guidance on how to go about this as I am still
new to using Fieldtrip.

Thank you in advance for your help.


Best,
Elsa Sangaran
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20210917/e57d5c4c/attachment.htm>


More information about the fieldtrip mailing list