Error while adding digitized points to raw EEG data

ch_names = [‘FP2’, ‘F7’,‘F3’,’ F4’,‘F8’,‘T3’,‘C3’,‘C4’,‘T4’,‘P3’,‘P4’,‘T6’,‘O2’,‘F9’,‘O1’,‘Fp1’,‘F10’,‘T5’]
ch_types = [‘eeg’,‘eeg’,‘eeg’,‘eeg’,‘eeg’,‘eeg’,‘eeg’,‘eeg’,‘eeg’,‘eeg’,‘eeg’,‘eeg’,‘eeg’,‘eeg’,‘eeg’,‘eeg’,‘eeg’,‘eeg’]
info = mne.create_info(ch_names=ch_names, sfreq=256, ch_types=ch_types)
h01.info = info
print(h01.info)

montage_kind = “standard_1020”
montage = mne.channels.make_standard_montage(montage_kind)
h01.set_montage(montage, match_case=False)

Iam trying to add digitized points to the eeg data i have acquired. The digitzed poits are added but im getting error while plotting the eeg data and getting the same “Assertion error” for every code im attempting to run after adding digitized points.
how to solve this issue.

Can you detail the error you are getting?

I’m surprised you can even add the montage to your data. Here is what I get with this snippet of code:

import mne


ch_names = ["FP2", "F7", "F3", "F4", "F8", "T3", "C3", "C4",
            "T4", "P3", "P4", "T6", "O2", "F9", "O1", "Fp1", 
            "F10", "T5"]           
info = mne.create_info(ch_names=ch_names, sfreq=256, ch_types="eeg")
info.set_montage("standard_1020")

Error:

ValueError: DigMontage is only a subset of info. There are 1 channel position not present in the DigMontage. The required channels are:

['FP2'].

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.

And indeed, if we look at your channel names, the first one does not conform to the standard 10/20 naming convention. It should be Fp2.

1 Like