[BUG] LCMV beamformer silently disregards EEG data
According to :ref:ex-source-loc-methods, the DICS beamformer at least only accepts a single channel type at a time. Since the covariance can be computed for both meg and eeg, that can be passed to apply_lcmv but then the filter channel names only include the meg channels so I assume the eeg channels are tossed. It seems that there should at least be a warning but probably more appropriately a NotImplementedError when eeg channels are passed that they will not have corresponding filters returned. cc @britta-wstnr
Can you clarify/tell me if I understand correctly that it is the latter case:
did make_lcmv just drop EEG channels, or did apply_lcmv drop them because your filter was done on MEG only?
If it is the latter case, then this behavior is expected and logical, but maybe we could still inform the user, by adding something like Warning: dropping any channels that are not present in the filter.
The first case where you pass in a covariance matrix with eeg also and you get out filters with only meg and no warning.
I would say warning about specific data channels not present in the filter even for apply makes sense to me.
Are you sure the info, noise covariance, data covariance, and forward were all meg+eeg? If any of them are incomplete it will restrict it
Ah you're right, the covariances actually were restricted before the beamformer, sorry!
Okay I would make this restriction a logger.info message rather than a warning
It was actually the forward model my bad! I think we could still log in beamformer that there was a channel mismatch.
I agree with @larsoner that this should be just an info. It's not a bug, but expected behavior - even though it might surprise the user :-)
@britta-wstnr @larsoner I was wondering whether I could take care of this issue (found it through a link to easy ones from the contribution guide).
I briefly looked at the code, and if I understood correctly, the function mne.utils.check._check_info_inv is taking care of the consistency between channels in the info, forward model, and the covariance matrices (both data and noise). Currently, the function mne.utils.check._compare_ch_names is called three times to remove channels that are not in fwd['info']['ch_names'], data_cov.ch_names, and noise_cov.ch_names. In between, MEG reference channels are also removed through a list comprehension. Should I log all removals separately including the number of channels removed, or just mention once that some channels were removed?
Hi @ctrltz! As far as I can see, this is indeed not implemented yet, so it would be great if you could take it on. I think we should log this once, not each time channels get dropped.