MNE version: e.g. 1.9.0, python: 3.12.6, OS: Windows 11
Hi,
we have been using MNE-python for source reconstruction of combined MEG+EEG data. Testing the quality with simulations, we noted that some results seemed rather odd, some single simulated sources move to other locations in the brain after fwd-inv-modeling, and correlations between time series before and after fwd-inv-modeling overall tended to be low.
Inspecting the forward operators, we then noticed that there may be a mismatch in the location of EEG channels by the MNE-python code.
Case 1: EEG channels are put after MEG channels in MNE-python:
This is what plotting the fwd[âsolâ][âdataâ] implies and also reflected in fwd[âsolâ][ârow_namesâ], although in fwd[âinfoâ][âch_namesâ], EEG channels are first, as in the raw data.
This, we think, can be explained by the sensor type order being de-facto hard-coded through the variable:
_FWD_ORDER = dict(meg=âMEGâ, eeg=âEEGâ)
in mne-python code mne\forward\forward.py, as channels are then read out in exact this order.
We are not fully sure yet if and how this affects the inverse operators; as far as I can see, the code for making inverse operators reads only fwd[âinfoâ][âch_namesâ], not fwd[âsolâ][ârow_namesâ], but we havenât figured out if this ch order actually influences computations.
Case 2: We got some fwd op files where the EEG channels end up in positions 242-305 in the fwd op, which is also reflected in fwd[âsolâ][ârow_namesâ]. We donât have any explanation for this yet.
For comparison, we also created fwd and inverse operators for one subject with MNE-C: Here, the EEG channels are also put at the end, but this is also reflected in fwd[âinfoâ][âch_namesâ], and when we use these operators for source reconstruction (in MNE-python, the simulation results for this subject improve dramatically.
Has this been observed before? Is there a simple way to make sure that the channel order is handled correctly/consistently throughout all steps in MNE-python?