Skip to content

attempt to fix interpolation of bad MEG sensors with applied compensation - #5321

Merged
agramfort merged 4 commits into
mne-tools:masterfrom
agramfort:fix_ctf_interp_comp
Jul 9, 2018
Merged

agramfort merged 4 commits into
mne-tools:masterfrom
agramfort:fix_ctf_interp_comp

Conversation

@agramfort

Copy link
Copy Markdown
Member

attempt to closes #5292

@larsoner @bloyl I need you help here.

to replicate the error run:

pytest mne/channels/tests/test_interpolation.py -k test_interpolation_ctf_comp

basically what happens is that doing info_to = pick_info(inst.info, picks_bad) here https://github.com/mne-tools/mne-python/blob/master/mne/channels/interpolation.py#L190

breaks as it wants to pick the info for just one data channel without the compensation channels.

help very much welcome.

cc @Heneark

@bloyl

bloyl commented Jul 6, 2018

Copy link
Copy Markdown
Contributor

Assuming that compensation matrices are ignored during the interpolation process, as seems to be the case, then this is fixed by changing

info_from = pick_info(inst.info, picks_good)
info_to = pick_info(inst.info, picks_bad)

to

    inst_info = inst.info.copy()
    inst_info['comps'] = []
    info_from = pick_info(inst_info, picks_good)
    info_to = pick_info(inst_info, picks_bad)

@codecov

codecov Bot commented Jul 8, 2018 •

Copy link
Copy Markdown

Codecov Report

Merging #5321 into master will increase coverage by <.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #5321      +/-   ##
==========================================
+ Coverage   88.22%   88.22%   +<.01%     
==========================================
  Files         358      358              
  Lines       66199    66209      +10     
  Branches    11252    11252              
==========================================
+ Hits        58401    58411      +10     
  Misses       4979     4979              
  Partials     2819     2819

@agramfort
agramfort merged commit f2fcc5a into mne-tools:master Jul 9, 2018
@agramfort

Copy link
Copy Markdown
Member Author

thx @bloyl for the feedback.

agramfort added a commit that referenced this pull request Jul 9, 2018
…tion (#5321)

* attempt to fix interpolation of bad MEG sensors with applied compenstation.

* do not include comps in interpolation

* update what's new

* put back ref meg
@agramfort

Copy link
Copy Markdown
Member Author

also backported to maint/0.16 branch

bloyl added a commit to bloyl/mne-python that referenced this pull request Oct 4, 2018
bloyl added a commit to bloyl/mne-python that referenced this pull request Oct 8, 2018
bloyl added a commit to bloyl/mne-python that referenced this pull request Oct 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: Compensation channels pick error

2 participants