How to read .eeg file from BrainVision Core Data Format in python?

1.9k Views Asked by At

I have a dataset in BrainVision Core Data Format which consists of the header file (.vhdr), marker file (.vmrk), and raw EEG data (.eeg) file for each subject. I know that python has mne.io.read_raw_brainvision() function which reads header file and returns a raw object containing BrainVision data. I do not know how to proceed after that or how can I read .eeg file. Thanks

2

There are 2 best solutions below

0
On BEST ANSWER

Overall, MNE Python has a great tutorial on handling raw EEG data: https://mne.tools/stable/auto_tutorials/raw/10_raw_overview.html#the-raw-data-structure-continuous-data

You can follow this tutorial and use the file loading with mne.io.read_raw_brainvision() as used in this more specific tutorial that happens to work with sample data in the BrainVision Core Data Format: https://mne.tools/stable/auto_tutorials/time-freq/50_ssvep.html#frequency-tagging-basic-analysis-of-an-ssvep-vssr-dataset

1
On
# Loading libraries
import mne
import os

# Loading BrainVision Data
# 1. Import path to Ale_piloto_1 from device
# 2. Import data from Ale_piloto_1 from device
data_path = './data/FileNamePath/'
vhdr_file = os.path.join(data_path, 'FileName.vhdr')
egg_file = os.path.join(data_path, 'FileName.eeg')

# MNE Workspace
# Import the BrainVision data into an MNE Raw object
raw = mne.io.read_raw_brainvision(vhdr_file, preload=True)