[Eeglablist] pop_writebva missing header info

Andreas Widmann widmann at uni-leipzig.de
Wed Sep 23 03:21:28 PDT 2020


Hi Roy,

> I've been using pop_writebva to convert an eeglab struct to a brainvision
> file. This works, and I can read it back in using pop_loadbv without
> problems.
> 
> (Minor question: what's the difference between pop_loadbv and pop_loadbva?)
pop_loadbv imports the „Brain Vision Data Exchange“ file format (vhdr + vmrk + eeg; written by pop_writebva). pop_readbva imports MATLAB files created by Brain Vision Analyzer (mat).

> However, I noticed that other platforms complain about missing resolution
> information in the header file, e.g., Fieldtrip:
> 
> *Warning: unknown resolution (i.e. recording units) for channel 1 in *
> [filename]
> 
> Looking at the header, this info is indeed missing:
By definition of the standard the resolution field may be empty (https://urldefense.com/v3/__https://www.brainproducts.com/files/public/products/more/BrainVisionCoreDataFormat_1-0.pdf__;!!Mih3wA!VnzXuuI2aDjRgIBeybs4dPqApJ3PccARdCyl6ds9QYwnlF_-utu5iV8sP98AuZfwY0J1jQ$ ). Therefore, I would rather consider this as a bug in the Fieldtrip importer.

> *[Channel Infos]; Each entry: Ch<Channel number>=<Name>,<Reference channel
> name>,; <Resolution in microvolts>,<Future extensions..; Fields are
> delimited by commas, some fields might be omited (empty).; Commas in
> channel names are coded as " ".Ch1=C3-M2,, Ch2=C4-M1,, *
> *etc..*
> 
> In case yet other software platforms deem this header information
> essential, how can I calculate/pass channel resolution into the header?
Try changing line 94 on pop_writebva.m
from
        fprintf(fid1, 'Ch%d=%s,, \n', index, EEG.chanlocs(index).labels);
to
        fprintf(fid1, 'Ch%d=%s,,1\n', index, EEG.chanlocs(index).labels);

Hope this helps! Best,
Andreas


More information about the eeglablist mailing list