Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
getting_started:brainvision [2018/10/04 12:51]
robert [Introduction]
getting_started:brainvision [2018/10/05 11:05] (current)
141.14.159.43 add further information on brainvision file format
Line 1: Line 1:
 {{tag>​dataformat brainvision eeg layout}} {{tag>​dataformat brainvision eeg layout}}
  
-====== Getting started with BrainVision ​Analyzer and Easycap ​======+====== Getting started with BrainVision ​file format ​======
  
  
 ==== Introduction ==== ==== Introduction ====
 [[http://​www.brainproducts.com|Brain Products]] provides technical and software solutions for neurophysiological and psychophysiological research and clinical applications. Their BrainAmp ExG amplifier allows to record signals with a sampling rate up to 5000 Hz and a broad hardware bandwidth ranging from DC to 1000 Hz. Brain Products also provides EEG caps, i.e. '​Easycaps',​ which contain the electrodes distributed over the head. These Easycaps are actually fabricated by http://​www.easycap.de,​ where you can also find more information. Although it is possible to use a BrainAmp amplifier with another type of cap, or to use an Easycap with an different amplifier, the most common case is to use them together and that is why we describe them jointly on this page. [[http://​www.brainproducts.com|Brain Products]] provides technical and software solutions for neurophysiological and psychophysiological research and clinical applications. Their BrainAmp ExG amplifier allows to record signals with a sampling rate up to 5000 Hz and a broad hardware bandwidth ranging from DC to 1000 Hz. Brain Products also provides EEG caps, i.e. '​Easycaps',​ which contain the electrodes distributed over the head. These Easycaps are actually fabricated by http://​www.easycap.de,​ where you can also find more information. Although it is possible to use a BrainAmp amplifier with another type of cap, or to use an Easycap with an different amplifier, the most common case is to use them together and that is why we describe them jointly on this page.
 +
 +==== Further information on the BrainVision file format ====
 +
 +The BrainVision file format consists of three separate files:
 +
 +  - A text header file (`.vhdr`) containing meta data
 +  - A text marker file (`.vmrk`) containing information about events in the data
 +  - A binary data file (`.eeg`) containing the voltage values of the EEG
 +
 +Both text files are based on the [[https://​en.wikipedia.org/​wiki/​INI_file|Microsoft Windows INI format]] consisting of:
 +
 +  * sections marked as `[square brackets]`
 +  * comments marked as `; comment`
 +  * key-value pairs marked as `key=value`
  
 <​note>​The BrainVision Recorded and Analyzer software packages use a well-defined file format that is supported by many software packages (e.g. EEGLAB, SPM, MNE-Python). The details of the file format are available in {{ :​getting_started:​brainvisioncorefileformat_1.0_2018-08-02.pdf |this specification }}. <​note>​The BrainVision Recorded and Analyzer software packages use a well-defined file format that is supported by many software packages (e.g. EEGLAB, SPM, MNE-Python). The details of the file format are available in {{ :​getting_started:​brainvisioncorefileformat_1.0_2018-08-02.pdf |this specification }}.
 </​note>​ </​note>​
 +
 +For example, see this excerpt from a BrainVision header file (.vhdr):
 +
 +    Brain Vision Data Exchange Header File Version 1.0
 +    ; Data synthesized by MNE-BIDS
 +    ​
 +    [Common Infos]
 +    DataFile=test.eeg
 +    MarkerFile=test.vmrk
 +
 +In this short example we can observe a challenge that is caused by having three separate files for each dataset: It means that the single files have internal pointers to each other'​s locations (see the DataFile and MarkerFile keys in the example).
 +
 +<​note>​
 +Manually renaming BrainVision datafiles will lead to an error because of not simulatenously updated header information. Paul Czienskowski from the MPI for Human Development in Berlin has written [[http://​code.google.com/​p/​eeg-renamer|eeg-renamer]],​ a small Windows program for renaming. Alternatively,​ you can use this simple [[https://​gist.github.com/​robertoostenveld/​e31637a777c514bf1e86272e1092316e|MATLAB renaming function]] that was written by Robert and subsequently improved by Cyril.
 +</​note>​
 +
 +<note tip>For validation of BrainVision file triplets, you can use the [[https://​github.com/​sappelhoff/​brainvision-validator|brainvision-validator]],​ which is a command line tool developed in nodejs.</​note>​
 +
  
 ==== Preprocessing of raw eeg data ==== ==== Preprocessing of raw eeg data ====
Line 21: Line 53:
 You can subsequently epoch your data using [[reference:​ft_definetrial|ft_definetrial]],​ and you can read in the data and preprocess it using [[reference:​ft_preprocessing|ft_preprocessing]]. Note that in FieldTrip, no unit conversion takes place. You can subsequently epoch your data using [[reference:​ft_definetrial|ft_definetrial]],​ and you can read in the data and preprocess it using [[reference:​ft_preprocessing|ft_preprocessing]]. Note that in FieldTrip, no unit conversion takes place.
  
-Sometimes users have already done some processing (e.g., rereferencing,​ epoching, artifact identification) in BrainVision Analyzer, and in order to avoid repeating the time consuming / subjective selection steps it might be preferable to start from the processed data. BrainVision Analyzer stores the processing steps in a so called history file, keeping the raw data unchanged, and applying the processing steps on-the-fly. This is not something that FieldTrip can work with, so you need to export your data first.+Sometimes users have already done some processing (e.g., rereferencing,​ epoching, artifact identification) in BrainVision Analyzer ​(BVA), and in order to avoid repeating the time consuming / subjective selection steps it might be preferable to start from the processed data. BrainVision Analyzer stores the processing steps in a so called history file, keeping the raw data unchanged, and applying the processing steps on-the-fly. This is not something that FieldTrip can work with, so you need to export your data first.
  
 ==== Exporting raw eeg data, applying BVA processing steps ==== ==== Exporting raw eeg data, applying BVA processing steps ====
Line 33: Line 65:
   - DataType should be '​TIMEDOMAIN'​   - DataType should be '​TIMEDOMAIN'​
   - BinaryFormat should be '​IEEE_FLOAT_32'​   - BinaryFormat should be '​IEEE_FLOAT_32'​
- 
-<​note>​ 
-Manually renaming BrainVision datafiles will lead to an error because of not simulatenously updated header information. Paul Czienskowski from the MPI for Human Development in Berlin has written [[http://​code.google.com/​p/​eeg-renamer|eeg-renamer]],​ a small Windows program for renaming. Alternatively,​ you can use this simple [[https://​gist.github.com/​robertoostenveld/​e31637a777c514bf1e86272e1092316e|MATLAB renaming function]] that was written by Robert and subsequently improved by Cyril. ​ 
-</​note>​ 
  
 <​note>​ <​note>​
Line 51: Line 79:
  
 Examples regarding the type of plots can be observed [[:​tutorial:​plotting|here]]. In the [[:​template:​layout|template]] directory you can find a collection of template layouts for plotting. If you want to create your own custom layout files, please have a look [[:​tutorial:​layout|here]]. ​ Examples regarding the type of plots can be observed [[:​tutorial:​plotting|here]]. In the [[:​template:​layout|template]] directory you can find a collection of template layouts for plotting. If you want to create your own custom layout files, please have a look [[:​tutorial:​layout|here]]. ​
 +
 +
 +