Groups of MEG channels according to their position

  • MNE version: 1.6.1
  • operating system: Windows 10

Hello everyone,

I want to make some statistics about the signal according to the MEG channel location, could someone tell me how I can make groups of channels according to their position? for .ds files this creates some confusion for me. I have tried with mne.read_vectorview_selection() but it does not support this type of file, error (ValueError: No match for selection name).
I am working with database ds000247 with subjects at rest.

Thanks in advance,

Greetings,

Xavier,

@Xavis – for CTF you can use the channel names to create groups.
The 1 index in the name gives L/R/Z and the 2 index gives the channel group.

raw.pick_types(meg=True, ref_meg=False)  #Drop the ref chans -- This function may be missing in the newest versions of MNE.  

chan_group={}
for ch in raw.ch_names:
     tmp_ = ch[1:3]
     if tmp_ not in chan_group.keys():
         chan_group[tmp_]=[ch]
     else:
         chan_group[tmp_].append(ch)
chan_group.keys()

–Jeff

Thanks for your response Jeff,

I am new to this field, is there a book, website or a videos where I can acquire basic knowledge. With all due respect, to me who does not come from the programming world, some times is difficult for me to understand the instructions in the mne tutorials.

Very grateful, hugs!
Xavier,

There are a ton of online resources:

Coursera has a bunch of free courses on python (example below).

And if you want a reference book for the concepts. There are a ton of different books on this – so any book on amazon/etc that has hundreds of positive reviews. Below is one of these.:
Learning Python, 5th Edition 5th Edition
by [Mark Lutz]

Medium.com is good to go into depth on a specific topic and great for a quick reference. Googling a python question generally leads to Stackoverflow, which is great for answering common questions.

Good luck. Python is a rewarding programming language.

–Jeff

1 Like

OK, thanks again!

Regards,