Problem with correct rank detection in make_LCMV due to _simplify_info

Hi,
When running the LCMV beamforming recently, I realized that info = _simplify_info(info) in mne.beamformer.make_lcmv removes the proc_history (MaxFilter processing history) from info.
make_lcmv uses rank=‘info’ by default, and when working with a MaxFilter-ed FIFF MEG file, it tries to detect the correct rank from MaxFilter’s processing history. But if the proc_history is unavailable, it uses the incorrect rank (usually 306).
Since there is no proc_history in info of raw (FIFF) data, the LCMV is not affected by _simplify_info.

While tracking the versions, I found that _simplify_info was first added to _lcmv.py in version 0.19.0

I tested LCMV source estimates with a multimodal dataset with (VEF, AEF, and SEF responses of the human data used in https://doi.org/10.1016/j.neuroimage.2020.116797) with versions 0.18.0, 0.23.4, and 1.0.0, and found:

  1. With 0.18.0, LCMV works fine both with raw and MaxFilter-ed datasets.
  2. With later versions, LCMV works fine with raw datasets, but the estimate goes wrong when using MaxFilter-filtered datasets.
  3. If we just remove/comment info = _simplify_info(info) in later versions, it works fine with the MaxFilter-ed dataset, too.

The function _simplify_info yields a simplified info structure to speed up picking in some other routines, but I didn’t find any reason to use it here in make_lcmv. So, should we remove it, or was there any other intention of using it here that I missed?

Here are the info structures before and after using _simplify_info for a test MEG dataset:

info = raw.info
print(info)

*<Info | 22 non-empty values*
* acq_pars: ACQch001 110113 ACQch002 110112 ACQch003 110111 ACQch004 110122 ...*
* acq_stim: 5 10.000000 500.000000 6 10.000000 500.000000*
* bads: []*
* ch_names: MEG 0113, MEG 0112, MEG 0111, MEG 0122, MEG 0123, MEG 0121, MEG ...*
* chs: 204 Gradiometers, 102 Magnetometers, 9 Stimulus, 1 EOG*
* custom_ref_applied: False*
* description: Vectorview system at BioMag*
* dev_head_t: MEG device -> head transform*
* dig: 21 items (3 Cardinal, 4 HPI, 14 Extra)*
* events: 1 item (list)*
* experimenter: neuromag*
* file_id: 4 items (dict)*
* highpass: 0.1 Hz*
* hpi_meas: 1 item (list)*
* hpi_results: 1 item (list)*
* lowpass: 172.2 Hz*
* meas_date: 2011-04-26 11:33:18 UTC*
* meas_id: 4 items (dict)*
* nchan: 316*
* proc_history: 1 item (list)*
* proj_id: 1 item (ndarray)*
* proj_name: test*
* projs: []*
* sfreq: 600.6 Hz*
* subject_info: 9 items (dict)*


info = _simplify_info(info)
print(info)

<Info | 3 non-empty values
 bads: []
 ch_names: MEG 0113, MEG 0112, MEG 0111, MEG 0122, MEG 0123, MEG 121, MEG ...
 chs: 204 Gradiometers, 102 Magnetometers, 9 Stimulus, 1 EOG*
 custom_ref_applied: False
 nchan: 316
 projs: []
  • MNE version: 1.0.0, 0.23.4, 0.18.0
  • operating system: Linux-3.10.0 (Centos 7)

info = _simplify_info(info)

1 Like

tagging @wmvanvliet and @britta-wstnr on this one (question about LCMV and MaxFilter)

crossref to GitHub PR: removed info = _simplify_info(info) from make_lcmv by neurosignal · Pull Request #11403 · mne-tools/mne-python · GitHub