You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ENH: mne.set_bipolar_reference should not ignore bad channels #11243
When setting the bipolar reference between one good and one bad channel, the final bipolar channel is marked as good.
Bad channels are marked as bad because they contain artefacts. The bipolar reference between a bad channel and a good channel can never yield a good channel as a result. Therefore, the resulting bipolar channels should be marked as bad by mne.
mne: 1.2.dev0
numpy: 1.23.2 {unknown linalg bindings (threadpoolctl module not found: No module named 'threadpoolctl')}
scipy: 1.9.0
matplotlib: 3.5.3 {backend=module://matplotlib_inline.backend_inline}
sklearn: Not found
numba: Not found
nibabel: 4.0.1
nilearn: Not found
dipy: Not found
openmeeg: Not found
cupy: Not found
pandas: 1.4.3
pyvista: 0.36.1 {OpenGL 4.1 Metal - 76.3 via Apple M1 Pro}
pyvistaqt: 0.9.0
ipyvtklink: Not found
vtk: 9.1.0
qtpy: 2.2.0 {None=None}
ipympl: Not found
pyqtgraph: Not found
pooch: v1.6.0
mne_bids: 0.10
mne_nirs: Not found
mne_features: Not found
mne_qt_browser: Not found
mne_connectivity: Not found
mne_icalabel: Not found
agreed set_bipolar_reference should update the info['bads'] and maybe even maybe warn that a bipolar channel is created from bad channels? …
Message ID: @.***>
Agreed. And to give an option we could have on_bad='raise' as a default, that way people can override with 'warn' or 'ignore' if they really know what they are doing
I think we should raise if a channel is bad, not just warn 🤔
Are you sure @hoechenberger? Usually, bad channels are easily excluded from further analysis, so it wouldn't hurt to add some bad bipolar channels to the instance. It could be very cumbersome to remove the bad channels from all anodes and cathodes manually before passing them to set_bipolar_reference.
@larsoner's suggestion seems reasonable to me if on_bad='warn' will be the default argument?
Activity
welcome commentedon Oct 13, 2022
Hello! 👋 Thanks for opening your first issue here! ❤️ We will try to get back to you soon. 🚴🏽♂️
agramfort commentedon Oct 13, 2022
moritz-gerster commentedon Oct 13, 2022
great, we currently work on a PR!
hoechenberger commentedon Oct 13, 2022
I think we should raise if a channel is bad, not just warn 🤔
larsoner commentedon Oct 13, 2022
Agreed. And to give an option we could have
on_bad='raise'as a default, that way people can override with'warn'or'ignore'if they really know what they are doingmoritz-gerster commentedon Oct 13, 2022
Are you sure @hoechenberger? Usually, bad channels are easily excluded from further analysis, so it wouldn't hurt to add some bad bipolar channels to the instance. It could be very cumbersome to remove the bad channels from all anodes and cathodes manually before passing them to
set_bipolar_reference.@larsoner's suggestion seems reasonable to me if
on_bad='warn'will be the default argument?moritz-gerster commentedon Oct 13, 2022
If
on_bad='raise', which error should be raised?ValueError?larsoner commentedon Oct 13, 2022
Use the
_on_missinghandler, it will take care of these conditionals and classes for you