Open dasdiptyajit opened 1 year ago
@larsoner generate_2d_layout.pos
doesn't return the same/similar matrix as it's for a build-in Layout. Is it because the function uses only 2D coordinates instead of 3D? It feels odd to me since the channel position differs quite a lot when you make a custom 2D layout for MEG. Any idea about it?
The Neuromag layout wasn't generated using generate_2d_layout
. I'm not sure how it was generated actually... but it's designed to be "nice" for the Neuromag system. The Neuromag system has sensor triplets all colocated at the same x/y/z. I don't think the automated generate_2d_layout
deals with this in any smart way, it probably just puts them all in the same location. The custom/builtin layout splits them so two are to the left and one to the right for example.
Yes, you are right! generate_2d_layout
puts the pairs (Neuromag_122) in the same location, hence both sensors overlap. In-built layout is designed differently somehow. Thanks for the reply.
Description of the problem
The issue is described in: https://mne.discourse.group/t/converting-gradiometers-to-virtual-magnetometers-for-neuromag-122/7056/6?u=dasdiptyajit
In short: During creating 2D custom layout, the API mne.channels.generate_2d_layout expects a continuous strings (e.g., without a space) for a channel name. For example, if the channel name is
MAG 000
instead ofMAG000
, APIplot_topo
doesn’t work (i.e., creates an empty figure)Steps to reproduce
Link to data
No response
Expected results
simulated_evoked.plot_topo(layout=custom_lay2)
should return similar results as insimulated_evoked.plot_topo(layout=custom_lay1)
Actual results
simulated_evoked.plot_topo(layout=custom_lay2)
returns an empty figure.Additional information
Step1: Simulates some evoked data for magnetometers (channel locations are missing) Setp2: Extracts xy coordinates from MNE example data to create a layout for simulated data Step3: tests the
plot_topo
API with 2 custom layouts. (one with original channel names and another with spaces)