Skip to content

BUG: Channel-Adjacency for Neuromag122 #8890

@marsipu

Description

@marsipu

Describe the bug

When I try to get the channel-adjacency-matrix for Gradiometer from Neuromag122-Data with find_ch_adjacency
, a matrix with dimensions 306x306 is given (when read from ./mne/channels/data/neighbors/neuromag122_neighb.mat).

And when I try to compute the adjacency with mne.channels.channels._compute_ch_adjacency, I get the following result:

File "C:\Users\marti\anaconda3\envs\mne\lib\site-packages\mne\channels\channels.py", line 1426, in _compute_ch_adjacency
xy = _find_topomap_coords(info, picks, sphere=HEAD_SIZE_DEFAULT)
File "C:\Users\marti\anaconda3\envs\mne\lib\site-packages\mne\channels\layout.py", line 624, in _find_topomap_coords
pos = _auto_topomap_coords(
File "C:\Users\marti\anaconda3\envs\mne\lib\site-packages\mne\channels\layout.py", line 723, in _auto_topomap_coords
raise ValueError('The following electrodes have overlapping positions,'
ValueError: The following electrodes have overlapping positions, which causes problems during visualization:
MEG 001, MEG 002, MEG 003, [...]

Steps to reproduce

import mne
data_path = "./neuromag122_test_file-raw.fif"
info = mne.io.read_info(data_path)
# Trying the load the channel-adjacency
ch_adjacency = mne.channels.find_ch_adjacency(info, 'grad')
print(ch_adjacency[0].shape)
# Trying to bypass mne.channels.read_ch_adjacency()
mne.channels.channels._compute_ch_adjacency(info, 'grad')

Expected results

A 122x122 Matrix

Actual results

A 306x306 Matrix and a Value Error

Additional information

I uploaded an anonymized raw-file from our Neuromag122 for reproduction of the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions