[Mne_analysis] Error about brainvision EEG data reading (Xia Tao)
Stefan Appelhoff
stefan.appelhoff at mailbox.org
Mon Jul 15 04:16:24 EDT 2019
External Email - Use Caution
Hi Everybody,
The vmrk file in the demo data contains the timestamp: 20141204100512303000
Let me quote from the BrainVision Recorder manual (Appendix C):
> The date has the following format:
> 4 digits = year
> 2 digits = month
> 2 digits = day
> 2 digits = hour (24-hour system)
> 2 digits = minute
> 2 digits = second
> 6 digits = microsecond
Thus, the recording date was the 4th of December, 2014 at 10:05.
To me, this date is well specified. What surprises me however, is the
"-1" in the line:
> Mk1=New Segment,,1,1,-1,20141204100512303000
The -1 corresponds to the channel index this event relates to. Usually,
this is "0" for the "New Segment" marker (because "0" means the event is
related to all channels). Perhaps this occurs, because the data was
written with PyCorder instead of the more commonly used BrainVision
Recorder? --> See third line in the .vhdr ... it could be a PyCorder bug?
Anyhow, the fix is to change a RegExp in our BrainVision IO code, so
that it can also deal with this unexpected negative number.
I have submitted a PR here:
https://github.com/mne-tools/mne-python/pull/6571
Let's continue the discussion on GitHub if needed.
Best,
Stefan
On 14.07.19 21:35, Alexandre Gramfort wrote:
> External Email - Use Caution
>
> hi,
>
> the problem is the following. The vhdr header file contains not timestamp
> of the onset of the recording but it's written in the vmrk that
> contains the annotations.
>
> The vmrk contains:
>
> Mk1=New Segment,,1,1,-1,20141204100512303000
>
> So when setting the annotations mne says it does not know the time
> of the raw data so it cannot place properly the annotations.
>
> I don't know if it's a bug in the MNE that should allow this. Maybe
> someone knows?
>
> In the mean time to fix it you can edit the vmrk file and replace the line above
> by:
>
> Mk1=New Segment,,1,1,-1,00000000000000000000
>
> hopefully this fixes the problem
>
> HTH
> Alex
>
> On Sun, Jul 14, 2019 at 5:37 AM Xia, Tao <psytao18 at connect.hku.hk> wrote:
>> External Email - Use Caution
>>
>> Hi Alex,
>> Thanks for the reply. Attached is one file in my analysis. The script as following:"raw_fname=('/home/eeg/sub6_Moral_asso_1.vhdr')
>> montage=mne.channels.read_montage('standard_1020')
>> raw=mne.io.read_raw_brainvision(raw_fname,montage,preload=True)"
>> Thank you very much.
>> Regards,
>> demo.zip
>>
>>
>> --
>> ---------------------------------------
>>
>> Tao Xia
>>
>> _______________________________________________
>> Mne_analysis mailing list
>> Mne_analysis at nmr.mgh.harvard.edu
>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
More information about the Mne_analysis
mailing list