Issue with Stimulations codes in the BrainVision Format File Writer/Reader

Concerning processing components: filters, file load/save, visualizations, communication ...
Post Reply
FilippoCastellani
Posts: 3
Joined: Mon Jul 26, 2021 11:50 am

Issue with Stimulations codes in the BrainVision Format File Writer/Reader

Post by FilippoCastellani »

Good evening.
My name is Filippo and i'm experiencing an issue with the BrainVision Format File Writer/Reader (I still don't know which of the two boxes is causing the issue).
The issue is the following:

The following files are all correctly generated ✔ by the writer
- filename .eeg
- filename .vhdr
In the sense that the content is correctly visualized and read by the reader.
In particular there is an issue with the file ❌
- filename .vmrk

It's content is correctly written and is present in the file.
(as I can report with this example of the file)

Code: Select all

 
Brain Vision Data Exchange Marker File, Version 1.0
[Common Infos]
DataFile=EEGEMG_data_training-[2023.04.05-12.02.21].eeg
[Marker Infos]
Mk1=Stimulus,OVTK_StimulationId_ExperimentStart,8484,1001,0
Mk2=Stimulus,OVTK_StimulationId_Label_01,11484,1001,0
Mk3=Stimulus,OVTK_StimulationId_TrialStart,13671,1001,0 

HERE THE FILE CONTINUES... 

But for some reason when OpenVibe tries to read the file it fails in recognizing the true values of the stimulation and prints the following (through Stimulation Listener)

Code: Select all

[  INF  ] At time 8.484 sec <Box algorithm::(0x00000dcb, 0x000046ae) aka Stimulation listener> For input 0 with name Stimulation stream 1 got stimulation 33024[OVTK_StimulationId_Label_00] at date 8.484 sec and duration 1.001 sec
[  INF  ] At time 11.484 sec <Box algorithm::(0x00000dcb, 0x000046ae) aka Stimulation listener> For input 0 with name Stimulation stream 1 got stimulation 33024[OVTK_StimulationId_Label_00] at date 11.484 sec and duration 1.001 sec
[  INF  ] At time 13.672 sec <Box algorithm::(0x00000dcb, 0x000046ae) aka Stimulation listener> For input 0 with name Stimulation stream 1 got stimulation 33024[OVTK_StimulationId_Label_00] at date 13.671 sec and duration 1.001 sec
Each and every stimulation is recognized as OVTK_StimulationId_Label_00 which is not true, and can be seen from the .vmrk file because it instead contains
- OVTK_StimulationId_ExperimentStart
- OVTK_StimulationId_Label_0
- and OVTK_StimulationId_TrialStart

How can i make OpenVibe actually recognize the true value of the stimulations ?


Any help and workaround would be very much appreciated.
Thanks very much.

Filippo Castellani

Thomas
Posts: 210
Joined: Wed Mar 04, 2020 3:38 pm

Re: Issue with Stimulations codes in the BrainVision Format File Writer/Reader

Post by Thomas »

Hi Filippo,

Thanks for the detailed post.

I could reproduce the issue you are facing, and there is a way for OpenViBE to recognise your stimulations.
When using the BrainVision Writer box, you need to provide a "Marker to OV Stimulation dictionnary" file (I'll detail the format below).

Indeed, the Reader box expect a slightly different format for the stimulations. Instead of receiving OVTK_StimulationId..., it expects letter 'S' followed by the stimulation code (e.g. S32769).

The dictionary file will allow the BrainVision Writer box to do this translation, so that the BrainVision Reader can read the stimulations properly.

The dictionary file can be a simple text file, with for each line 3 coma separated values: <Type>,<Descrption>,<OVStimuation>.

For exemple,

Code: Select all

Stimulus,S32769,OVTK_StimulationId_ExperimentStart
  • Type (Stimulus): BrainVision marker type. It is the only one supported in OpenViBE, so it should always be Stimulus.
  • Description (S32769): The letter 'S', followed by the stimulation code that can be found on the stimulation codes page of OpenViBE.
  • OVStimulation (OVTK_StimulationId_ExperimentStart): The OpenViBE naming style of the stimulation.

You need to add one line for each stimulation that you need to translate!

I am not sure why this was not hard-coded in the BrainVision Writer box as I imagine everyone will have the same dictionary matching the stimulations with their codes.
I'll add an update ticket to improve this in the future.

Hope this helped, let us know if you encounter any issue using the dictionary.

Cheers,
Thomas

Post Reply