Repository navigation
Closed
Description
Describe the new feature or enhancement
If info is provided when using mne.viz.plot_csd, it only looks for EEG and MEG channels to plot.
Describe your proposed implementation
Maybe there are some data channel types we don't want to extend this functionality too, but at least seeg, ecog, and dbs makes sense.
Could also improve DRY in the code:
Lines 1485 to 1506 in 8dd298f
| if info is not None: | |
| info_ch_names = info["ch_names"] | |
| sel_eeg = pick_types(info, meg=False, eeg=True, ref_meg=False, exclude=[]) | |
| sel_mag = pick_types(info, meg="mag", eeg=False, ref_meg=False, exclude=[]) | |
| sel_grad = pick_types(info, meg="grad", eeg=False, ref_meg=False, exclude=[]) | |
| idx_eeg = [ | |
| csd.ch_names.index(info_ch_names[c]) | |
| for c in sel_eeg | |
| if info_ch_names[c] in csd.ch_names | |
| ] | |
| idx_mag = [ | |
| csd.ch_names.index(info_ch_names[c]) | |
| for c in sel_mag | |
| if info_ch_names[c] in csd.ch_names | |
| ] | |
| idx_grad = [ | |
| csd.ch_names.index(info_ch_names[c]) | |
| for c in sel_grad | |
| if info_ch_names[c] in csd.ch_names | |
| ] | |
| indices = [idx_eeg, idx_mag, idx_grad] | |
| titles = ["EEG", "Magnetometers", "Gradiometers"] |
Describe possible alternatives
N/A
Additional context
No response
Reacted by Aniket
Activity
Aniketsy commentedon Mar 1, 2026
I’d be happy to look into this and open a PR shortly.
Akhila21-6 commentedon Mar 18, 2026
Hi! I'm Akhila, a final-year B.Tech student and GSoC 2026 applicant. I have experience with Python and data visualization (Matplotlib/Streamlit). I'm interested in working on this enhancement to expand supported channel types for CSD plotting. I've already begun setting up the local environment—could a mentor point me to the specific files where the current channel checks are defined?
tsbinns commentedon Mar 18, 2026
Thanks for your interest in the issue, but there is already a PR in #13713 that addresses this (and which is very close to completion already).
Akhila21-6 commentedon Mar 19, 2026