-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/interpolate channels #480
Feat/interpolate channels #480
Conversation
fix event list in tests
moabb/datasets/preprocessing.py
Outdated
# Trick: mark these channels as bad | ||
raw.info["bads"].extend(missing_channels) | ||
# ...and use mne bad channel interpolation to generate the value of the missing channels | ||
raw.interpolate_bads(origin=(0, 0, 0.04)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @gcattan , I really like your idea about channel interpolation to match electrodes of two datasets.
Is there a reason why in interpolate_bads you have selected origin (0, 0, 0.04) ? Option "auto" will fit a sphere to headshape based on the existing electrodes and determine its radius and origin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi! I am not sure it will work if the montage is disabled. But let me try.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Sara04 I added a try-catch, so we first try with the 'auto' parameter, and default to (0, 0, 0.04) in case of ValueError. This happens, for example, when there is no montage information. The braindecode pipeline fails, but I don't think the issue originates from this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @gcattan ! Yes, it doesn't seem that it fails due to this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All checks passed. @Sara04 FYI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @gcattan !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. Is it ok to merge this PR then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me it is OK. @sylvchev , @bruAristimunha do you have some other comments?
9337792
to
0f8b864
Compare
…n/moabb into feat/interpolate_channels
…n/moabb into feat/interpolate_channels
Head branch was pushed to by a user without write access
@bruAristimunha @Sara04 |
Done :) |
This PR modifies the
match_all
method inside base paradigm, which set-up the paradigm to be compatible with a list of datasets.It is now possible to select the intersection of the channels in all datasets, or their union.
For example, if you pass two datasets:
d1 -> Cz, Fz
d2 -> Cz, C4,
then the
channels
attribute inside the paradigm can contain either: Cz or {Cz, Fz, C4}.In the case you selected the union of all channels, then missing channels in dataset d1 or d2 will be interpolated using mne.
This interpolation is done directly in the
RawToEpochs
transformer.@bruAristimunha FYI