Setting custom_ref_applied for ECoG data
See original GitHub issueSetting average reference for ECoG data
When using the raw.set_eeg_reference(ref_channels='average') to perform a common average reference on ECoG data, the custom_ref_applied bool flag in raw.info remains set to False. I looked at io/reference.py and in the function definition for set_eeg_reference it appears that when _apply_reference is called, it looks only for channels of type ‘eeg’ is ‘custom_ref_applied’ set to True.
Also, in the comments for _apply_reference, it appears to say that info['custom_ref_applied']=True refers to a “non-CAR” reference, but the test is whether the reference includes EEG electrodes (which it would for an average reference, right?)
My general question then, is, for consistency, should custom_ref_applied=True after applying an average reference to ECoG data, or am I misunderstanding the use of this flag? It seems like a nice marker for whether this operation has happened or not. Happy to help fix if this makes sense. I see this is similar to this issue: https://github.com/mne-tools/mne-python/issues/6454, but not exactly.
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (12 by maintainers)

Top Related StackOverflow Question
Rather than force a deprecation cycle, I would just add a
ch_typeargument toset_eeg_reference. It leaves it as a misnomer but sinceset_eeg_referenceis mandatory for inverse modeling, it’s going to be all over the place for users so the pain of deprecating this function is quite high.@libertyh just a heads up that we’re looking to release 0.20 in the next couple of weeks so if you want this fix to make it into that release we’ll have to iterate somewhat quickly. No rush from our end, though