-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
BUG: Fix bug with regress_artifact picking #12389
Conversation
... and I realized I could greatly simplify some stuff and make the dataset dual-use for mne-tools/mne-bids-pipeline#837 by BIDSifying it, so those changes are in here, too. |
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.
LGTM other than my 2 comments.
mne/_fiff/pick.py
Outdated
@@ -687,6 +688,15 @@ def pick_info(info, sel=(), copy=True, verbose=None): | |||
if info.get("custom_ref_applied", False) and not _electrode_types(info): | |||
with info._unlock(): | |||
info["custom_ref_applied"] = FIFF.FIFFV_MNE_CUSTOM_REF_OFF | |||
# remove unused projectors | |||
if info.get("projs", []): |
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.
I stumbled over this line, because seeing the []
in foo.get("bar", [])
made me expect that the result was being assigned or iterated over. Here we're only (effectively) passing it to bool()
for the duration of this one line; so I think it's clearer to default to False
rather than a (falsey) empty list.
if info.get("projs", []): | |
if info.get("projs", False): |
tutorials/inverse/95_phantom_KIT.py
Outdated
# Now we can figure out our epoching parameters and epoch the data, sanity checking | ||
# some values along the way knowing how the stimulation was done. |
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.
seems like this text may need to be updated? Looks like the "sanity checking" is all deleted now
Done, marking for merge when green, thanks for the quick look @drammock ! |
EOGRegression
check for projections only applicable to the channels being processed. So if you want to regress MEG sensors using a reference channel for example, it shouldn't matter whether or not there is an average EEG reference projector.pick_info
remove any projectors that are no longer relevant to the data. So if you start with M/EEG data and remove all EEG channels, you should no longer have an EEG reference projector ininfo
. I went back and forth on this one a bit but I think this is the most reasonable behavior.