Hi all,
I am trying to run an ICA decomposition on spinal electrophysiology data, itβs very simple code at the minute, and the relevant part of the code looks like this:
ICA
ica = mne.preprocessing.ICA(n_components=15, max_iter='auto', random_state=97)
ica.fit(raw_filtered)
raw.load_data()
ica.plot_sources(raw, show_scrollbars=False)
plt.show()
Iβm essentially following the tutorial here at the moment (Repairing artifacts with ICA β MNE 0.24.1 documentation)
Unfortunately, the above code throws up the following error:
Traceback (most recent call last):
File β/data/pt_02569/python/main.pyβ, line 67, in
run_post_ica(subject, condition, srmr_nr, sampling_rate)
File β/data/pt_02569/python/Post_ICA.pyβ, line 66, in run_post_ica
ica.plot_sources(raw, show_scrollbars=False)
File β/data/pt_02569/python/venv/lib/python3.6/site-packages/mne/preprocessing/ica.pyβ, line 1852, in plot_sources
show_scrollbars=show_scrollbars)
File β/data/pt_02569/python/venv/lib/python3.6/site-packages/mne/viz/ica.pyβ, line 88, in plot_ica_sources
show_scrollbars=show_scrollbars)
File β/data/pt_02569/python/venv/lib/python3.6/site-packages/mne/viz/ica.pyβ, line 989, in _plot_sources
inst_array.set_annotations(inst.annotations)
File ββ, line 24, in set_annotations
File β/data/pt_02569/python/venv/lib/python3.6/site-packages/mne/io/base.pyβ, line 659, in set_annotations
new_annotations._prune_ch_names(self.info, on_missing)
File β/data/pt_02569/python/venv/lib/python3.6/site-packages/mne/annotations.pyβ, line 422, in _prune_ch_names
on_missing, 'At least one channel name in β
File β/data/pt_02569/python/venv/lib/python3.6/site-packages/mne/utils/check.pyβ, line 757, in _on_missing
raise error_klass(msg)
ValueError: At least one channel name in annotations missing from info: S35
I canβt find the reason for this error - if I print raw.ch_names and raw_filtered.ch_names, I get the following identical output:
[βS35β, βS24β, βS36β, βIzβ, βS17β, βS15β, βS32β, βS22β, βS19β, βS26β, βS28β, βS9β, βS13β, βS11β, βS7β, βSC1β, βS4β, βS18β, βS8β, βS31β, βSC6β, βS12β, βS16β, βS5β, βS30β, βS20β, βS34β, βACβ, βS21β, βS25β, βL1β, βS29β, βS14β, βS33β, βS3β, βALβ, βL4β, βS6β, βS23β, βECGβ]
and if i print the ica.info variable, the ch_names are similarly given as:
ch_names: S35, S24, S36, Iz, S17, S15, S32, S22, S19, S26, S28, S9, S13, β¦
So evidently channel S35 is present in both the ica and the raw structures, so I canβt understand how this error (βAt least one channel name in annotations missing from info: S35β) comes to be.
Any help/advice would be greatly appreciated!
- MNE version: 0.23.4
- operating system: Ubuntu 18.04.6
Edit to add: ica.plot_overlay is working as expected so it is potentially just a bug in the plot_sources function