How to process data with MNE after BrainVision?

I have three files after one research. I’m not fully familiar with processing data of EEG experiments, so I will write what I understand just for now.

I have three files .eeg, .vhdr and .vmrk. I would like to get features and then classify this data for making some conclusion. I used such code:

import mne
import os

data_path = './'
vhdr_file = os.path.join(data_path, 'S01_Baseline.vhdr')
egg_file = os.path.join(data_path, 'S01_Baseline.eeg')

raw = mne.io.read_raw_brainvision(vhdr_file, preload=True)

and as a result I have such output in console:

Extracting parameters from ./S01_Baseline.vhdr...
Setting channel info structure...
Reading 0 ... 63259  =      0.000 ...   126.518 secs...
/Users/angor/PycharmProjects/eegProcessing/main.py:13: RuntimeWarning: Channels contain different lowpass filters. Highest (weakest) filter setting (131.00 Hz) will be stored.
  raw = mne.io.read_raw_brainvision(vhdr_file, preload=True)

I don’t understand fully how to fix this error, because as I saw in the official tutorials I don’t have to set any channels info. Also maybe you can give me some advises about such data processing.

Thank you in advance!

Also channel info is here:

Ch1=1,,0.0406901,µV
Ch2=2,,0.0406901,µV
Ch3=3,,0.0406901,µV
Ch4=4,,0.0406901,µV
Ch5=5,,0.0406901,µV
Ch6=6,,0.0406901,µV
Ch7=7,,0.0406901,µV
Ch8=8,,0.0406901,µV
Ch9=9,,0.0406901,µV
Ch10=10,,0.0406901,µV
Ch11=11,,0.0406901,µV
Ch12=12,,0.0406901,µV
Ch13=13,,0.0406901,µV
Ch14=14,,0.0406901,µV
Ch15=15,,0.0406901,µV
Ch16=16,,0.0406901,µV
Ch17=17,,0.0406901,µV
Ch18=18,,0.0406901,µV
Ch19=19,,0.0406901,µV
Ch20=20,,0.0406901,µV
Ch21=21,,0.0406901,µV
Ch22=22,,0.0406901,µV
Ch23=23,,0.0406901,µV
Ch24=24,,0.0406901,µV
Ch25=25,,0.0406901,µV
Ch26=26,,0.0406901,µV
Ch27=27,,0.0406901,µV
Ch28=28,,0.0406901,µV
Ch29=29,,0.0406901,µV
Ch30=30,,0.0406901,µV
Ch31=31,,0.0406901,µV
Ch32=32,,0.0406901,µV
Ch33=x_dir,,1,mg
Ch34=y_dir,,1,mg
Ch35=z_dir,,1,mg
  • MNE version: 1.6.1
  • operating system: macOS last

This is not an error, it is just a warning letting you know that not all channels share the same filter settings, and MNE only stores the highest (weakest) filter setting. It doesn’t perform any filtering or other processing of your data, it just stores that filter setting value in raw.info for later reference. You encounter this warning because the last three channels are not EEG and therefore likely have different filter settings.

1 Like

Thank you for your response, but how then to proceed these files? because this crash stops the program :frowning: and how then get some more readable data

This is not a crash, only a warning. You can ignore it for now.

but it does not allow to run script further, it stops and that is all. Maybe I need to set some additional metadata for that?

What is the next line in your script?

all script is in the question, I’m trying in general analyze the EEG data, but for the beginning I tried just to read it, I tried :slight_smile: so what to do next with available data I still don’t know, I mean how to get features for example

This doesn’t add up, your script should not stop because of the warning. There must be something else going on. Without seeing your script, I’m afraid we won’t be able to help.

but the script is in the question, and it’s all what I have, I just see this warning and that is all, maybe I can try to use raw data and the warning will not stop it, but for now maybe script reaches the end of it and that is all

Your script has simply finished running. There is nothing wrong with it. :slight_smile:

ah… so all is workable, and another additional question is how to put custom montage to the raw data, I tried with:

montage = mne.channels.make_standard_montage('biosemi32')
raw = mne.io.read_raw_brainvision(vhdr_file_base_1, montage=montage, preload=True)

but I got such error:

 Traceback (most recent call last):
  File "/Users/angor/PycharmProjects/eegProcessing/main.py", line 13, in <module>
    raw = mne.io.read_raw_brainvision(vhdr_file_base_1, montage = montage, preload=True)  # read raw data with mne
TypeError: read_raw_brainvision() got an unexpected keyword argument 'montage'

I also tried with setting it manually here:
raw.set_montage(montage)

and got an error:

ValueError: DigMontage is only a subset of info. There are 32 channel positions not present in the DigMontage. The channels missing from the montage are:

['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32'].

Consider using inst.rename_channels to match the montage nomenclature, or inst.set_channel_types if these are not EEG channels, or use the on_missing parameter if the channel positions are allowed to be unknown in your analyses.

so it’s better to use set_channel_types or rename_channels or how to put cap schema for the research?

I’d rename the channels to match those present in a montage.

Please open a new topic for new questions. Thank you!

1 Like