Skip to content
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: pick_types with KIT #2805

Closed
kingjr opened this issue Jan 20, 2016 · 6 comments
Closed

BUG: pick_types with KIT #2805

kingjr opened this issue Jan 20, 2016 · 6 comments

Comments

@kingjr
Copy link
Member

kingjr commented Jan 20, 2016

In pick_type() when there's a bad channel:

from mne.channels import find_layout
from mne.io import read_raw_kit
fname = 'mne-python/mne/io/kit/tests/data/test.sqd'
raw = read_raw_kit(fname, preload=True)
print('raw', find_layout(raw.info))
raw.pick_types(meg=True)
print('raw pick_type', find_layout(raw.info))
raw.info['bads'] += ['MEG 002']
print('raw bad', find_layout(raw.info))
raw.pick_types(meg=True)
print('raw bad pick_type', find_layout(raw.info))

gives:

('raw', <Layout | KIT-157 - Channels: MEG 001, MEG 002, MEG 003 ...>)
('raw pick_type', <Layout | KIT-157 - Channels: MEG 001, MEG 002, MEG 003 ...>)
('raw bad', <Layout | KIT-157 - Channels: MEG 001, MEG 002, MEG 003 ...>)
('raw bad pick_type', None)

This makes the whole plotting function incompatible once a sensor is rejected.

@Eric89GXL @teonlamont

@teonbrooks
Copy link
Member

Yeah, I came across this problem too...temp workaround is to interpolate bad channels then the layout will work. The problem I had when working on a patch is dealing with the sparse matrix operations like removing a channel are not easy

@agramfort
Copy link
Member

the find_layout function should be robust to a small fraction of bad channels

@kingjr
Copy link
Member Author

kingjr commented Jan 21, 2016

I didn't to fix it. @teonlamont are you up for it?

@teonbrooks
Copy link
Member

@kingjr unfortunately I can't. I'm swamped :( can't really make contributions (just more issues) until after D-Day 😅

@jaeilepp
Copy link
Contributor

I could make a simple fix. You'll have to see what you think about it...

@jaeilepp
Copy link
Contributor

Fixed.

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

No branches or pull requests

4 participants