Adding montage to the raw BrainVision EEG data

I have to add montage information to the raw EEG data (.vhdr). I don’t have the coordinates file, but I know the channel names, and it is a standard 1020 electrode placement. I get the following error.

  • MNE-Python version: 0.24.0
  • operating system: Windows

montage = raw.set_montage(‘standard_1020’)

ValueError: DigMontage is only a subset of info. There are 32 channel positions not present in the DigMontage. The required channels 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.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.

channel_names =[‘Fp1’,‘Fp2’,‘F7’,‘F3’,‘Fz’,‘F4’,‘F8’,‘FC5’,‘FC1’,‘FC2’,‘FC6’,
‘FC6’,‘T7’,‘C3’,‘Cz’,‘C4’,‘T8’,‘TP9’,‘CP5’,‘CP1’,‘CP2’,‘CP6’,
‘TP10’,‘P7’,‘P3’,‘Pz’,‘P4’,‘P8’,‘PO9’,‘01’,‘Oz’,‘O2’]

Above are the channel names. Would you please give me a solution?

I believe there is the option to ignore the problem by setting on_missing as ‘ignore’, but do inspect the result afterwards

You can circumvent this problem by reading a custom montage:
montage = mne.channels.read_custom_montage(‘Cap19coord_1020.csd’)`
raw.set_montage(montage)

1 Like

You need to rename the channels to match the 10-20 naming scheme. It appears currently they all just numbered.

You can use raw.rename_channels() for this.

Best wishes,
Richard

3 Likes

Thank you for the suggestion. I solved it by renaming the channels.