<div dir="ltr"><font face="arial, sans-serif">Dear all, </font><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">I am having some trouble with the exported data (averages of different conditions in my experiment) which I preprocessed on Brain Vision Analyzer. </font>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: </div><div><br></div><div>Script: </div><div><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:blue">for</span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:black"> subj = (name_subj)</span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:black"> </span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:rgb(60,118,61)">%
(re)set directory to the directory that contains the trialfun</span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:black"> subject = subj{:};</span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:black"> </span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:black"> </span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:black">seg_file
=[dir_raw_data_external subject </span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:rgb(160,32,240)">'.seg'</span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:black">]; </span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:rgb(60,118,61)">%Subject's .seg file, ie. 'pilot1.seg'</span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:black">header_file
=[dir_raw_data_external subject </span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:rgb(160,32,240)">'.vhdr'</span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:black">]; </span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:rgb(60,118,61)">%Subject's .vhdr file, ie. 'pilot1.vhdr'</span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:black"> </span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:black">cfg = []; </span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:black">cfg.dataset = seg_file;</span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:black">hdr =
ft_read_header(header_file);</span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:black">nTrials = hdr.nSamples/trial_length;</span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:black">hdr.nTrials = nTrials;</span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:black">hdr.nSamples = trial_length;</span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:black">dat = ft_read_data(seg_file,</span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:rgb(160,32,240)">'header'</span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:black">, hdr); </span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:black">cfg.label = channel_labels; </span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:black">cfg.trial =
squeeze(num2cell(dat,[1 2]))';</span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:black">cfg.hdr = hdr;</span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:black">cfg.time =
repmat({[time_start:(time_end-time_start)/trial_length:time_end-(time_end-time_start)/trial_length]},1,nTrials);</span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:black">cfg.label = cfg.hdr.label;</span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:black">cfg.trialinfo = [];</span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:black">cfg.sampleinfo = [0 300]; </span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:black">cfg.fsample = 250;</span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:black">data_raw = cfg;</span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:black"> </span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:rgb(60,118,61)">% make variables for
header and eeg file</span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:rgb(60,118,61)">% headerfile
= [dir_raw_data_external subject '.vhdr'];</span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:rgb(60,118,61)">% segfile
= [dir_raw_data_external subject '.seg'];</span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="DE" style="font-size:10pt;font-family:"Courier New";color:rgb(60,118,61)">% </span><span lang="DE" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="DE" style="font-size:10pt;font-family:"Courier New";color:rgb(60,118,61)">% cfg =
[];</span><span lang="DE" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="DE" style="font-size:10pt;font-family:"Courier New";color:rgb(60,118,61)">%
cfg.headerfile = headerfile;</span><span lang="DE" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:rgb(60,118,61)">% cfg.dataset = segfile;</span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:rgb(60,118,61)">% data_raw = ft_preprocessing(cfg);</span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:rgb(60,118,61)">% </span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:black"> </span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:rgb(60,118,61)">%cfg.trialdef.eventtype = 'string'</span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:rgb(60,118,61)">%cfg.trialdef.eventvalue =
number, string or list with numbers or strings</span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:black"> </span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:black"> </span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:black"> cfg = [];</span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:black"> cfg.trialdef.prestim = 0.2;</span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:black"> cfg.trialdef.poststim = 1;</span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:black"> cfg.trialdef.eventtype = </span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:rgb(160,32,240)">'Time
0'</span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:black">;</span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:black"> cfg.trialdef.eventvalue = </span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:rgb(160,32,240)">''</span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:black">;</span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:black"> cfg.trialdef.triallength = 1.2;</span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:black"> cfg.trialdef.ntrials = 1;</span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:black"> </span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:black"> cfg.headerfile = header_file;</span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:black"> cfg.datafile = seg_file;</span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:black"> cfg_deftrial = ft_definetrial(cfg);</span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:black"> data_segmented = ft_redefinetrial(cfg_deftrial,
data_raw);</span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif">
</p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:blue">end</span><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New""></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-GB" style="font-size:10pt;font-family:"Courier New";color:black"><br></span></p><p class="MsoNormal" style="margin:0cm;line-height:normal"><font face="arial, sans-serif" style=""><span lang="EN-GB" style="color:black">For </span><span style="color:rgb(0,0,0)">ft_definetrial, I get the following warnings:</span></font></p><p class="MsoNormal" style="margin:0cm 0cm 8pt;line-height:107%"></p><ul><li><span lang="EN-GB"><font face="arial, sans-serif">Warning:
could not determine dimord of "dataset"</font></span></li><li><span lang="EN-GB"><font face="arial, sans-serif">Warning:
inconsistent sampleinfo</font></span></li><li><span lang="EN-GB"><font face="arial, sans-serif">Warning:
inconsistent trialinfo</font></span></li></ul><p></p><p class="MsoNormal" style="margin:0cm 0cm 8pt;line-height:107%"><span lang="EN-GB"><font face="arial, sans-serif">For ft_redefinetrial, I get the following warnings: </font></span></p><p class="MsoNormal" style="margin:0cm 0cm 8pt;line-height:107%"></p><ul><li><span lang="EN-GB" style=""><font face="arial, sans-serif" style="">Warning:
the data does not contain sampleinfo </font></span></li><li><span lang="EN-GB"><font face="arial, sans-serif">Warning:
reconstructing sampleinfo by assuming that the trials are consecutive segments
of a continuous recording</font></span></li></ul><p></p><p class="MsoNormal" style="margin:0cm 0cm 8pt;line-height:107%"><span lang="EN-GB"><font face="arial, sans-serif">
</font></span></p><p class="MsoNormal" style="margin:0cm 0cm 8pt;line-height:107%"><span style="font-family:arial,sans-serif;color:rgb(17,17,17)">I appreciate your advice and guidance on how to go about this as I am still new to using Fieldtrip. </span></p><p class="MsoNormal" style="margin:0cm 0cm 8pt;line-height:107%"><span style="color:rgb(17,17,17);font-family:arial,sans-serif">Thank you in advance for your help.</span></p><p class="MsoNormal" style="margin:0cm 0cm 8pt;line-height:107%"><span style="color:rgb(17,17,17);font-family:arial,sans-serif"><br></span></p></div><div><div dir="ltr" data-smartmail="gmail_signature"><div dir="ltr"><font face="arial, sans-serif">Best,</font><div><font face="arial, sans-serif">Elsa Sangaran</font></div></div></div></div></div>