Integration of .eeg and .vmrk files from Brainvision Pycorder

Good morning! We currently collecting data through Pycorder with the Brainvision ActiChamp. We obtain two files per recording session, which we need to integrate in order to identify stimulus markers. The file extensions are: .eeg and .vmrk. We are using Brainstorm for data processing and analysis, but we haven’t been able to find a way to integrate this information. Your help will be most appreciated.

Hello,

Based on the file extensions, it looks like it’s using the same format as the other BrainVision products.
You should be able to open those files using the popup menu “Review raw file”, then select the file format “BrainVision BrainAmp (*.vmrk)”.
Please let me know if you get errors or inconsistent results, we might have to do some adjustments to the reading functions (in_fopen_brainamp, in_fread_brainamp, in_events_brainamp).

See the Epilepsy/EEG tutorial for more information on how to process EEG data with Brainstorm:
http://neuroimage.usc.edu/brainstorm/Tutorials/Epilepsy

Cheers,
Francois

Dear Francois, we truly appreciate your prompt response. We are able to import the .eeg file into each subject. When we try to add the .vmrk file to be able to work with stimulus markers, we are unable to find it in the folder because in the file options, that extension does not show in the dropdown menu in Brainstorm. Could you please help us with the steps we should be taking before adding these two files? Thanks again for your help.

You should have three files in the same folder with exactly the same name, but different extensions:
example.vhdr, example.eeg, example.vmrk
In this configuration, the three files should be read at the same time when you use the menu “Review raw file” and you should not have any additional step in order to add the markers.

To load separately an events file:

  • Double-click on the Link to raw file to open it
  • In the Record tab, menu File > Add events from file > Select file format “BrainVision BrainAmp (*.vmrk)”

If you do not get anything new in your file, the format of the marker file might be slightly different than our functions are expecting.
If so, please zip those three files and send then to me (upload it somewhere, ie dropbox, then click on my username on this forum to then me the link in a separate email).

Thanks,
Francois

Thank you for sending me an example file.
If you just use the menu “Review raw file” with the file you sent me it works exactly as expected.
There is only one marker “Mk” in the .vmrk file, and it is loaded in Brainstorm automatically.
See the attached screen capture.

Thanks for taking the time to help me find the problem. I did see that marker, but I thought somehow it wasn’t loading properly. That means the problem is occurring in the recording stage. Thanks again!!
Idaly

For debugging purposes, you can read the .vmrk files easily: they are simple text files.

[QUOTE=Francois;8063]For debugging purposes, you can read the .vmrk files easily: they are simple text files.[/QUOTE]

Dear Francois, would it be possible for you to send me a sample .vmrk file? I would like to compare it it with ours to see if we can determine if we are actually recording markers. Thank you so much!

Sure.
Here are a few examples:
https://www.dropbox.com/s/cnigega0orfvo03/example_vmrk.zip?dl=1
Francois

Note for BrainVision / BrainAmp users:
A bug was found in the application of the channel gain, the amplitudes read where sometimes incorrect.
Please update Brainstorm for reading correct amplitudes from the BrainVision files.

Hi Francois,

I am having the same issue mentioned above. I have a folder with (.eeg),(.vhdr), and (.vmrk). When I used the “Review raw file” function on the drop down menu, I could not read all three files at the same time because the drop down menu did not allow that. I also tried using the "MEG/EEG: 4D-Neuroimaging/BTI(.*)" option to read all three files at the same time, but it gave me the following error: “No config file”. Please let me know how I can resolve this issue, your advice is greatly appreciated.

Thank you,

Wasuwat

When you select the file format “EEG: BrainVision BrainAmp (*.eeg)”, it lets you select only the recordings (the .eeg file), but it actually reads the .vhdr and .vmrk too, these are the file headers without which we cannot read the .eeg files.

Dear Francois,

A follow up question on this topic on Brainvision markers and how they are read by Brainstorm. I understand the idea that only the .eeg file appears when trying to review raw files, but brainstorm reads the other two (.vmrk and .vhdr). Why is it that I cannot epoch the data using the markers read from those files, though?

When I click on "import data", the usual window is displayed with all the markers with [ext] in front of them. If I click in any of them, the option where we can specify the time window for our epochs becomes unavailable. That is, it seems as though I cannot specify the epoch length when using the markers that are automatically read from the .vmrk files.

Thanks in advance.

When I click on "import data", the usual window is displayed with all the markers with [ext] in front of them. If I click in any of them, the option where we can specify the time window for our epochs becomes unavailable.

Your events are read as extended events:
https://neuroimage.usc.edu/brainstorm/Tutorials/EventMarkers#Extended_events

These events already have their own duration defined, you can't redefine that when importing these time segments:
https://neuroimage.usc.edu/brainstorm/Tutorials/Epoching#Import_in_database

If you want to enable this option, you need to convert the extended events to simple events first:
https://neuroimage.usc.edu/brainstorm/Tutorials/EventMarkers#Other_menus

Super clear. Thanks a lot Francois!