Repository navigation
Ensure all reference channels are used during final average referencing - #92
Conversation
Codecov Report
@@ Coverage Diff @@
## master #92 +/- ##
=======================================
Coverage 98.51% 98.51%
=======================================
Files 7 7
Lines 675 675
=======================================
Hits 665 665
Misses 10 10
Continue to review full report at Codecov.
|
sappelhoff
left a comment
There was a problem hiding this comment.
is there any situation where it would make sense to only use a subset of all channels for final average reference calculation, post-interpolation?
I don't think so 🤔 you wouldn't even be able to call it an average reference if not all channels that are part of the data are averaged with respect to all of them.
This fix seems good, thanks for catching it!
That's what I thought. Wondering if that part of the default API (i.e., needing to specify "referenced" and "rereferenced" channels manually in the params dict instead of just defaulting to all EEG channels) might be worth changing before PyPREP officially leaves its "experimental" stage. |


PR Description
Closes #90. This PR fixes the issue by making
reference_channelsa local variable withinReference.robust_reference()so that it doesn't affect theself.reference_channelsvariable that's used to select reference channels duringReference.perform_reference().As an aside, is there any situation where it would make sense to only use a subset of all channels for final average reference calculation, post-interpolation? Wondering if the whole
reference_channelsparameter is a carry-over from MatPREP that only exists because EEGLAB doesn't have as nice a method of marking non-EEG channels as MNE. In MatPREP, channels are excluded from being sources for interpolation if they're not specified in the "reference channels" parameter, whereas PyPREP just uses all non-bad EEG channels, but I'm not sure if that would ever actually be a problem.Merge Checklist
closes #<issue-number>to automatically close an issue