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
While trying to execute evoked.interpolate_bads(), I ran into the following error:
mne\channels\interpolation.py", line 190, in _interpolate_bads_meg
info_to = pick_info(inst.info, picks_bad)
mne\io\pick.py", line 411, in pick_info
'channels' % (current_comp, comps_missing))
RuntimeError: Compensation grade 3 has been applied, but compensation channels are missing: ['BG1-2805', 'BG2-2805', 'BG3-2805', 'G11-2805', 'G12-2805', 'G13-2805', 'G22-2805', 'G23-2805', 'P11-2805', 'P13-2805', 'Q11-2805', 'Q13-2805', 'R11-2805', 'R12-2805', 'R13-2805', 'R22-2805', 'R23-2805']
Either remove compensation or pick compensation channels
This error seems to be raised automatically when attempting to make any pick that does not include all ref_meg channels. I dug a bit into compensation grades, and it seems that it can only be removed for Raw data using the apply_gradient_compensation(0) method.
Maybe it would be better to turn this error into a warning? Indeed in my case, compensation channels are not removed from data, the function only attempts to separately pick bad channels to compute interpolation.
Another way could be to always include these channels, similar to the ref_meg='auto' argument of pick_types(), but I'm not sure it would make sense in every case (especially this one).
Thanks,
Indeed this should probably not be an error, see our current plan for fixing these sorts of issues here.
Although for the case of interpolate_bads, I'm not sure what the right thing to do would be -- maybe we should go back to grade 0, interpolate, then re-apply whatever compensation was there originally. @bloyl@agramfort any ideas on this one?
I just tried to run my source reconstruction scripts, and it turns out this bug is everywhere (evoked.plot_joint, beamformer.make_lcmv), nothing works anymore since I upgraded from v0.15 to v0.16 last week.
I upgraded to mne 0.16.2, plot_joint() is fixed, interpolate_bads() is fixed, but pick_types(ref_meg=False) still raises an error, thus the error from beamformer.make_lcmv() still occurs.
Well, this is the dedicated issue about compensation raising an error during picks since v0.16 (related to #5221). I provided a snippet for interpolation, but since picks occur in lots of mne functions, the error will probably be present elsewhere (e.g. in beamformer.make_lcmv as I pasted the traceback in my previous comment), hence my suggestion to fix picks in the first place.
Thanks for making it. We want to fix the problem generally, but the best solution will take some time. In the meantime it's quicker to squash the bugs one by one.
I'm having the same problem with the 0.16.2 version. I cannot pick_types(ref_meg=False) without gettting the same error as in the top post , and if I then pick_types(ref_meg=True), beamformer.make_lcmv will raise the error instead. Could beamformer.make_lcmv be issuing the error because the number of channels in info and forward arguments are different (since forward will not include the compensation channels)? I don't want to change the compensation grade, so what I have been doing is to set info['comps']=[] and it works, but it is a hack.
Activity
larsoner commentedon Jun 22, 2018
Indeed this should probably not be an error, see our current plan for fixing these sorts of issues here.
Although for the case of
interpolate_bads, I'm not sure what the right thing to do would be -- maybe we should go back to grade 0, interpolate, then re-apply whatever compensation was there originally. @bloyl @agramfort any ideas on this one?[-]Compensation channels pick error[/-][+]BUG: Compensation channels pick error[/+]Heneark commentedon Jun 22, 2018
I just tried to run my source reconstruction scripts, and it turns out this bug is everywhere (evoked.plot_joint, beamformer.make_lcmv), nothing works anymore since I upgraded from v0.15 to v0.16 last week.
larsoner commentedon Jun 22, 2018
Oof, that's not good. While we work on a proper fix, you could turn it into a
warnings.warnin your local copy of the MNE codeagramfort commentedon Jun 23, 2018
agramfort commentedon Jun 24, 2018
@Heneark #5295 has been merged. Can you provide some test snippet so we can fix ASAP and release 0.16.2
thanks
Heneark commentedon Jun 25, 2018
I downloaded the master branch, evoked.plot_joint() is indeed fixed.
Here's a test snippet for the interpolation error:
https://gist.github.com/Heneark/2e18280f88f956ae5faef3cea40e4bd0
Same error with beamformer (no bad channel involved):
Cheers,
agramfort commentedon Jul 6, 2018
have a look #5321
it's not finished though.
agramfort commentedon Jul 9, 2018
@Heneark it should be fixed now. I also pushed a new version 0.16.2 to pypi.
you can do:
pip install -U mne
and hopefully everything should now work smoothly.
thanks for reporting the issue and your patience.
Heneark commentedon Jul 11, 2018
I upgraded to mne 0.16.2,
plot_joint()is fixed,interpolate_bads()is fixed, butpick_types(ref_meg=False)still raises an error, thus the error frombeamformer.make_lcmv()still occurs.@agramfort Should I open another issue?
agramfort commentedon Jul 11, 2018
Heneark commentedon Jul 11, 2018
Well, this is the dedicated issue about compensation raising an error during picks since v0.16 (related to #5221). I provided a snippet for interpolation, but since picks occur in lots of mne functions, the error will probably be present elsewhere (e.g. in
beamformer.make_lcmvas I pasted the traceback in my previous comment), hence my suggestion to fix picks in the first place.Here's a snippet if you want to replicate the beamformer error:
https://gist.github.com/Heneark/a183a24218302831860efc86c84c1950
larsoner commentedon Jul 11, 2018
I think you meant to link here
https://gist.github.com/Heneark/a183a24218302831860efc86c84c1950
Thanks for making it. We want to fix the problem generally, but the best solution will take some time. In the meantime it's quicker to squash the bugs one by one.
lclaudino commentedon Oct 30, 2018
Hello there
I'm having the same problem with the 0.16.2 version. I cannot
pick_types(ref_meg=False)without gettting the same error as in the top post , and if I thenpick_types(ref_meg=True),beamformer.make_lcmvwill raise the error instead. Couldbeamformer.make_lcmvbe issuing the error because the number of channels ininfoandforwardarguments are different (sinceforwardwill not include the compensation channels)? I don't want to change the compensation grade, so what I have been doing is to setinfo['comps']=[]and it works, but it is a hack.Any ideas? Thanks!
agramfort commentedon Oct 30, 2018