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

Issues computing connectivity with CTF system #6069

Open
jasmainak opened this issue Mar 19, 2019 · 10 comments
Open

Issues computing connectivity with CTF system #6069

jasmainak opened this issue Mar 19, 2019 · 10 comments
Labels

Comments

@jasmainak
Copy link
Member

jasmainak commented Mar 19, 2019

I got a report that the connectivity computation was problematic. If you have a CTF-270 system, the function find_ch_connectivity gives you the connectivity of the CTF-275 system. Code to reproduce:

import mne
from mne.channels import find_ch_connectivity

contrast = mne.evoked.read_evokeds('./S1_discrimination_conds-ave.fif',
                                   condition='contrast_RP', verbose=None)

connectivity, ch_names = find_ch_connectivity(contrast.info, ch_type='mag')
assert connectivity.shape[-1] == len(contrast.info['ch_names'])

here is the file: https://www.dropbox.com/s/bae8rjdu068ws14/S1_discrimination_conds-ave.fif?dl=0.

My suggestion would be to make _compute_ch_connectivity public and deprecate the find_ch_connectivity function. The guesswork in the function introduces more problems than solves.

@agramfort
Copy link
Member

for MEG we use fieldtrip neighbors files:

https://github.com/fieldtrip/fieldtrip/tree/master/template/neighbours

I don't see any file for CTF 270.

any idea how to know what CTF system is used, maybe given the channel names?

@jasmainak
Copy link
Member Author

okay so apparently it's a CTF-275 system with 5 bad channels

@agramfort
Copy link
Member

agramfort commented Mar 21, 2019 via email

@mmagnuski
Copy link
Member

@jasmainak - Fieldtrip neighbours structure gives adjacency information by channel name so you should still be able to use those files. Can you choose channels when reading connectivity in mne?

@jasmainak
Copy link
Member Author

Yes, you are correct. This is what I realized after posting the issue. I think it's not technically a bug but more a surprising behavior. As people expect the same number of channels in the connectivity matrix as the info.

Regarding this particular data, the info did not have these 5 channels from the beginning (as far as I know).

@agramfort
Copy link
Member

agramfort commented Mar 22, 2019 via email

@mmagnuski
Copy link
Member

@agramfort In the extreme that is possible, but I doubt it would be a common scenario. We could warn when some channels from adjacency are not present in info (and maybe the other way too). Disconnected components are already allowed at the source level (left and right hemi).

@agramfort
Copy link
Member

agramfort commented Mar 22, 2019 via email

@mmagnuski
Copy link
Member

Yes - and there is another benefit of accepting the ch_names present in info: if the order of channels is different in fieldtrip neighbours file and the info - they would be sorted in the correct order (I'm not sure it is done now).

@agramfort
Copy link
Member

agramfort commented Mar 22, 2019 via email

@jasmainak jasmainak added the BUG label Oct 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants