Skip to content

Expand channel types supported for CSD plotting #13711

Closed

Description

@tsbinns

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:

mne-python/mne/viz/misc.py

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

Activity

  1. Aniketsy commented on Mar 1, 2026

    @Aniketsy
    Contributor

    I’d be happy to look into this and open a PR shortly.

  2. Akhila21-6 commented on Mar 18, 2026

    @Akhila21-6

    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?

  3. tsbinns commented on Mar 18, 2026

    @tsbinns
    MemberAuthor

    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?

    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).

  4. Akhila21-6 commented on Mar 19, 2026

    @Akhila21-6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions