mne-tools / mne-python

MNE: Magnetoencephalography (MEG) and Electroencephalography (EEG) in Python
https://mne.tools
BSD 3-Clause "New" or "Revised" License
2.66k stars 1.31k forks source link

Add method for channel interpolation to predefined channel positions/montage #12486

Open apmellot opened 6 months ago

apmellot commented 6 months ago

Describe the new feature or enhancement

I have recently been working with datasets with diverse montages and wanted to make them comparable by ensuring a consistent number and position of channels across datasets. Currently, achieving this requires hacking in MNE internal functions such as mne.channels.interpolation._map_meg_or_eeg_channels or mne.channels.interpolation._make_interpolation_matrix, and is not straightforward for users. This new method would simplify the process. I believe a similar issue was raised in #12409.

Describe your proposed implementation

The proposed implementation involves introducing a new method, interpolate_to, to either the mne.io.Raw or mne.Epochs class. This method would:

Describe possible alternatives

The parameter montage could also be a list of str with the position names, or a str for the name of a template montage that would be defined in MNE.

Additional context

No response

welcome[bot] commented 6 months ago

Hello! 👋 Thanks for opening your first issue here! ❤️ We will try to get back to you soon. 🚴

apmellot commented 6 months ago

@antoinecollas @agramfort

larsoner commented 6 months ago

I think this can be tackled at the same time and using hopefully the same API as https://github.com/mne-tools/mne-python/issues/9609, can you check?

larsoner commented 6 months ago

... specifically this proposal:

https://github.com/mne-tools/mne-python/issues/9609#issuecomment-901203391

agramfort commented 6 months ago

+1 for interpolate_to method next to interpolate_bads

sappelhoff commented 1 month ago

+1, this would be a cool feature