Channel positions not present in DigMontage

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

[‘FP1’, ‘VEOG’, ‘FPz’, ‘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.

I’ve tried this method,and it still hasn’t worked out

locs_info_path = “D:\ProgramData\jupyter\10_20.txt”

montage = mne.channels.read_custom_montage(locs_info_path)

new_chan_names = np.loadtxt(locs_info_path, dtype=str, usecols=3)

old_chan_names = raw.info[“ch_names”]
chan_names_dict = {old_chan_names[i]:new_chan_names[i] for i in range(32)}

raw.rename_channels(chan_names_dict)

raw.set_montage(montage)

Hello @yonglongwen and welcome to the forum!

Like the error message says, there are channels in your data that are not present in the montage you want to set. You can ignore this problem by passing on_missing='warn' (just raises a warning instead of failing), but I suggest you fix / update your montage file to include FP1, FPz, and FP2. It could also be that the only thing that’s different between your data and the montage is the casing of the channel names; you can try and see if passing match_case=False helps.

VEOG should probably be converted to an eog type channel, as I doubt it will be present in your montage.

Best wishes,
Richard

Thanks a lot .
I’ve tried it the way you said, I still haven’t solved it.
I don’t konw “match_case=False” is what.
How to fix / update your montage file to include FP1 , FPz , and FP2 .
I think name is correct.
If possible,I can send you a copy of my data. May I ask you email address.

I sincerely hope you can help me. It is my email address:Yonglongwen@outlook.com
I can provide a data for you,please you can check it .

match_case is a parameter of the raw.set_montage() method: mne.io.Raw — MNE 0.24.1 documentation

If your data contains channels FP1, FPz, and FP2, then you should use a montage that contains locations for those channels. In other words, perhaps the custom montage you’re using is the wrong one, or is incomplete. Based on this line:

it seems like you’re trying to set a standard 10-20 montage, maybe you should try raw.set_montage('standard_1020')?

When I do,such as

montage = mne.channels.make_standard_montage(“standard_1020”)
raw.set_montage(montage,on_missing=‘ignore’)

8-3.eeg
8-3.vhdr
8-3.vmrk
Since I need to use electrode points to draw a topographic map, I need to solve this problem and need to understand the process


Thank you for your guidance, I 've solved it.

A post was split to a new topic: overlapping channels in plot_psd_topo

actually, you haven’t solved it. Look at the middle of the sensor plot, you’ll see there are several overlapping channels. See overlapping channels in plot_psd_topo for the correct solution.

1 Like

Thank you,I learned a lot