set_eeg_reference to multiple channel types
See original GitHub issueIssue
I am analyzing data sets consisting of both ECoG and SEEG channels. One of our preprocessing step is to apply CAR the ecog and seeg channels. In order to ensure comparability between the different electrodes (regardless of whether they are seeg or ecog), we need to apply CAR to all ecog and seeg channels at once, the average to apply also being across seeg and ecog channels. While the set_eeg_reference enables to state which channels should be taken to compute the average, it is only possible to set one channel type as which channels to apply it to.
I have been doing it sequentially at first:
raw.set_eeg_reference(projection=False, ref_channels=ref_channels, ch_type='seeg')
then:
raw_sig.set_eeg_reference(projection=False, ref_channels=ref_channels, ch_type='ecog')
(ref_channels being all seeg and ecog channels here)
This is obviously wrong, as when the second statement is reached, CAR has already been applied to the seeg channels, making the second round of CAR wrong.
Proposed implementation
Would it be possible to pass a list of channel type instead of a single string.
Alternatively, would it be possible to pass a list of channels to apply the CAR to?
Additional comments
Apologies if this a misunderstanding of how things work, I am still rather new to mne. I would offer to handle it myself and do a PR, I am however very uncertain that my programming skill fullfil the mne standards.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top GitHub Comments
We should allow
ch_type
to be alist of str
to support this use case. This seems like a fairly small change, with little risk of users shooting themselves in the foot (they have to explicitly pass such a list, so presumably know what they want).We all start somewhere, and we’re happy to help you along. And if you get stuck or run out of time to work on it, maintainers can push commits to your branch. So a PR would be welcome if you’re up for it!
closed by #9637