wrong meg channel

Hello everyone :slight_smile: I have a problem/question:

The system used to acquire the MEG data Iā€™m working with had 275 MEG axial gradiometers, however, in the info data structure this is indicated as channel type ā€˜magā€™. Is there a way to change all channel types from ā€˜magā€™ to ā€˜gradā€™, preferably within the evoked data file?
I am working with:

  • MNE version: 0.23.4
  • operating system: Windows 10

Thank you!

Hello,

Raw, Epochs or Evoked all have a set_channel_types method.
e.g. mne.Evoked ā€” MNE 1.0.0 documentation
It can be used by providing a mapping with the key being the channel names the value the new channel type.

Mathieu

Hi Mathieu!
Thanks for responding to me.
However, the documentation of the set_channel_types method doesnā€™t say it supports the channel types ā€˜gradā€™ and ā€˜magā€™, so I am not sure what to do thereā€¦
Kind regards,
Janne

I guess the documentation could be updated. Could you open an issue on the GitHub issue tracker?
It does seems to work as intended:

import mne
import numpy as np


data = np.random.randint(0, 10, size=90).reshape((3, 30))
info = mne.create_info(['1', '2', '3'], 1000, ch_types=['mag', 'grad', 'grad'])
raw = mne.io.RawArray(data, info)
raw.set_channel_types({'1': 'grad', '2': 'mag', '3': 'mag'})

Before: chs: 1 Magnetometers, 2 Gradiometers
After: chs: 1 Gradiometers, 2 Magnetometers

I would think that we should assign the correct channel types from the start, automatically ā€¦ what kind of data is that, @Janne?

@Janne - By the number of channels and having axial gradiometers - it appears that you have a CTF system. The axial gradiometers are treated a magnetometers in the MNE software. I am assuming this is because they have a more similar signal profile to mag than the planar gradiometers in Elekta/Megin. You do not need to convert these to grad - just use them as ā€˜magsā€™ in MNE. Below is from the CTF system at NIMH (271 out of 275 good channels) - it shows the gradiometers as ā€˜magsā€™. I think that there is another post in the MNE forums about this.

Out[9]: 
<Info | 16 non-empty values
 bads: []
 ch_names: SCLK01-177, BG1-1609, BG2-1609, BG3-1609, BP1-1609, BP2-1609, ...
 chs: 6 misc, 28 Reference Magnetometers, 271 Magnetometers, 2 EEG
 comps: 5 items (list)
 ctf_head_t: CTF/4D/KIT head -> head transform  
2 Likes

Here is the context for why axial gradiometers are considered ā€˜magsā€™:

1 Like

@agramfort Do you think we should issue an informative log message when this happens during reading CTF data? As we see here, itā€™s confusing, albeit being documented (?) behavior.

1 Like

Hi Mathieu,
This seems to work indeed.
Thank you!
Kind regards,
Janne

Hi Jeff,

Thank you for responding. It is indeed a CTF system.
Eventually, I changed the channel type to ā€˜gradā€™ because I had trouble when computing the adjacency matrix for cluster analysis. I got an error when the channel type was ā€˜magā€™, so I changed the channels to ā€˜gradā€™, and then it worked.
Otherwise, just using them as ā€˜magā€™ in MNE should work fine too.

Thanks again,
Kind regards,
Janne