No valid channel positions found

Hi everyone, I’m working on preprocessing the EEG CHB-MIT database (CHB-MIT Scalp EEG Database v1.0.0). I’m trying to plot ICA components, however i always get a error message. I’ve already set the montage to the standard 10-20 system but still doesn’t work.
My code:

pip install mne
from google.colab import drive
drive.mount('/content/drive')
cd /content/drive/MyDrive/EDFfiles/Paciente_24
fname = 'chb24_01_edited.edf'

import mne
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt

raw = mne.io.read_raw_edf(fname, preload=True, verbose=False)

from mne.preprocessing import (ICA, create_eog_epochs, create_ecg_epochs,
                               corrmap)

montage = mne.channels.make_standard_montage('standard_1020')

raw.set_montage(montage, on_missing='ignore')

print(raw.ch_names)

filt_raw = raw.copy().filter(l_freq=1., h_freq=None)

ica = ICA(n_components=15, max_iter='auto', random_state=97)
ica.fit(filt_raw)
ica

raw.load_data()
ica.plot_sources(raw, show_scrollbars=False)
raw.plot_sensors(ch_type='eeg', show_names=True)
RuntimeError: No valid channel positions found
ica.plot_components()
RuntimeError: Did not find any digitization points of kind FIFFV_POINT_EEG (3) in the info.

Hello @Hanna and welcome to the forum!

Here, you’re explicitly asking set_montage() to ignore (instead of fail on) missing coordinates for your channels. You should not need to do this. I believe the source of the problem lies here somewhere: setting the montage fails, but you never get an error message because you explicitly ignoring the errors.

This has nothing to do with ICA, but it’s a problem with the montage / channel locations.

Best wishes,
Richard

You’re right, here is the error message:

raw.set_montage(montage)`

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

['FP1-F7', 'F7-T7', 'T7-P7', 'P7-O1', 'FP1-F3', 'F3-C3', 'C3-P3', 'P3-O1', 'FP2-F4', 'F4-C4', 'C4-P4', 'P4-O2', 'FP2-F8', 'F8-T8', 'T8-P8-0', 'P8-O2', 'FZ-CZ', 'CZ-PZ', 'P7-T7', 'T7-FT9', 'FT9-FT10', 'FT10-T8', 'T8-P8-1'].

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.