sccn / bva-io

Routines for loading and saving data files in Brain Vision Data Exchange format (export and import of Brain Vision Analyzer MATLAB files developed by Arnaud Delorme)
23 stars 11 forks source link

Discrepencies with imported files compared to Brain vision #5

Open arnodelorme opened 4 years ago

arnodelorme commented 4 years ago

I’ve noticed some small deviations when I compare the output of pop_writebva with original brainvision data.

1) There is an additional marker in the beginning: “Mk1=Time 0,,1,0,0,0". This results in a different numbering of markers, and in the writebva output there is one marker more than in the original data

2) the differentiation between "Stimulus" and "Response" markers is lost in the export, even though this information is preserved in the EEG.event structure. Replacing line 132 EEG.event(index).type = 'Stimulus'; with
EEG.event(index).type = EEG.event(index).code; seems to fix this.

3) very very minor: "\1" is not correctly written into the output file, but an additional \ in line 126 should fix that (\1)

4) is there any way to preserve the date information stored with the first New Segment marker? Mk2=New Segment,,1,0,0,0 % output from write_bva Mk1=New Segment,,1,1,0,20170816200208360070 % line from original vmrk file I guess this is related to the EEG.bvtime field. But since I get there a negative number, I'm not sure how exactly it works. Usually I wouldn't care about that, but if you have synchronous video, this is a useful piece of information.

Many thanks and best regards, Clemens

bknakker commented 3 years ago

Regarding point 4, I have a working version where I import the segment date/time information as a MATLAB datetime object. I'd be happy to file a pull request but I'm not sure whether MATLAB datetime would be the right solution here, as I'm afraid it would be incompatible with older MATLAB versions, Octave, etc. Is there a policy on how EEGLAB should handle date/time information? It would be nice if I could modify my code to a "pullable" solution.

arnodelorme commented 3 years ago

Datetime is an old function. I think it will be compatible. Make a pull request and I will check. Tx

On Aug 9, 2021, at 9:46 AM, bknakker @.***> wrote:

Regarding point 4, I have a working version where I import the segment date/time information as a MATLAB datetime object. I'd be happy to file a pull request but I'm not sure whether MATLAB datetime would be the right solution here, as I'm afraid it would be incompatible with older MATLAB versions, Octave, etc. Is there a policy on how EEGLAB should handle date/time information? It would be nice if I could modify my code to a "pullable" solution.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

cmaidhof commented 2 months ago

@bknakker, do you also have by any chance a version where the bvtime field is written during export from eeglab back to bv format? I guess that makes sense though only when there has been no data deleted in the beginning of a recording... It would be great if the bvtime info could "survive" import and export.

bknakker commented 2 months ago

@bknakker, do you also have by any chance a version where the bvtime field is written during export from eeglab back to bv format? I guess that makes sense though only when there has been no data deleted in the beginning of a recording... It would be great if the bvtime info could "survive" import and export. @cmaidhof, I did not work with the writing functions. (Also unfortunately I only made an in-house version for myself that reads bvtime, but shamefully I did not go on to produce a version that meets policies/requirements and would be mergeable.)