How to get fif montage with channel

My data is meg data from MEGIN/Elekta Neuromag VectorView and TRIUX in .fif format.
I want to get the montage of fif. Then use the eelbrain package to read the montage of fif for subsequent data generation and plotting of the results.

Currently, I use mon_fif = raw.info.get_montage() and dig_fif = mne.channels.read_dig_fif(file_path) to get the montage file, but neither of them has the channel information, the result is as follows < DigMontage | 137 extras (headshape), 4 HPIs, 3 fiducials, 0 channels>.
I have seen this message Note that electrode names are not present in the .fif file so they are here defined with the convention from VectorView systems (EEG001, EEG002. etc.), but this doesn’t seem to indicate how to fix the problem.
I would like to get the effect like this easycap_montage = mne.channels.make_standard_montage(‘standard_alphabetic’)
<DigMontage | 0 extras (headshape), 0 HPIs, 3 fiducials, 65 channels>

:question: If you have a question or issue with MNE-Python, please include the following info:
Platform: Linux-5.15.0-69-generic-x86_64-with-glibc2.31
Python: 3.10.10 | packaged by conda-forge | (main, Mar 24 2023, 20:08:06) [GCC 11.3.0]
CPU: x86_64: 6 cores
Memory: 47.0 GB
mne: 1.3.1
numpy: 1.23.5 {OpenBLAS 0.3.21 with 6 threads}
scipy: 1.10.1
matplotlib: 3.7.1 {backend=agg}
sklearn: 1.2.2
numba: 0.56.4
nibabel: 5.0.1
nilearn: 0.10.0
dipy: 1.6.0
openmeeg: 2.5.5
cupy: Not found
pandas: 1.5.3
pyvista: 0.38.5 {OpenGL could not be initialized}
pyvistaqt: 0.9.1
ipyvtklink: 0.2.2
vtk: 9.2.6
qtpy: 2.3.1 {None=None}
ipympl: Not found
pyqtgraph: 0.13.2
pooch: v1.7.0

mne_bids: Not found
mne_nirs: Not found
mne_features: Not found
mne_qt_browser: 0.4.0
mne_connectivity: Not found
mne_icalabel: Not found

@elvisjade I think you are talking about the standard layout of the system.

MNE has some built-in layouts. You can check if you can find your meg system’s layout there.
Here is the link to follow :
https://mne.tools/stable/auto_tutorials/intro/40_sensor_locations.html

Check the section: Working with layout files

best,
Dip

2 Likes

Wondering if this is the part you are talking about? builtin_montages = mne.channels.get_builtin_montages(descriptions=True)
for montage_name, montage_description in builtin_montages.
print(f’{montage_name}: {montage_description}')

There doesn’t seem to be a montage for the device I’m using MEGIN/Elekta Neuromag VectorView and TRIUX, which I’ve checked here.

@dasdiptyajit is refering to a Layout. A Layout represents the idealized 2D representations of sensor position as seen from above. Several built-in layouts are available (full list here) among which:

  • Neuromag_122
  • Vectorview-all
  • Vectorview-grad
  • Vectorview-grad_norm
  • Vectorview-mag

I’m guessing Vectorview-all is what you are looking for:

from mne.channels import read_layout

layout = read_layout("Vectorview-all")
layout.plot()

A montage represents the 3D location of sensors and is primarily used for EEG. All the montage returned by get_builtin_montages are EEG montage.

If you want the position information of your sensors, MEG or EEG, it is stored in .info["chs"] which contains a list of dictionaries. Each dictionary contain sensor information, among which the loc, an array of shape (12,) contains the sensor position:

Channel location. For MEG this is the position plus the normal given by a 3x3 rotation matrix. For EEG this is the position followed by reference position (with 6 unused). The values are specified in device coordinates for MEG and in head coordinates for EEG channels, respectively.

Mathieu

2 Likes

Thank you very much for your suggestion, I will try to use layout to see if it works.