mne-python icon indicating copy to clipboard operation
mne-python copied to clipboard

RuntimeWarning for channels with different filter settings on import

Open cbrnr opened this issue 1 month ago • 12 comments

Recently (as of #12441), MNE started to raise warnings when importing EDF/BDF files containing channels with different filter settings (see here):

RuntimeWarning: Channels contain different highpass filters. Highest filter setting will be stored.
RuntimeWarning: Channels contain different lowpass filters. Lowest filter setting will be stored.

There are three issues with this behavior:

  1. All channels are used to check for identical filter settings. This is not a good idea, since different channel types are likely to have different filter settings. In particular, STIM channels are also considered in this comparison, so BDF files always trigger the warning (STIM channels contain empty filter strings).
  2. I think the warning message (and possibly also the resulting behavior) is incorrect. IMO, if channels (of the same type) contain different highpass filters, the lowest filter setting should be stored. Similarly, for different lowpass filters, the highest setting should be stored. These correspond to the weakest thresholds, and this is how it's done in read_raw_brainvision() (see here and here). Interestingly, read_raw_nsx() also seems to do the wrong thing (see here).
  3. In my opinion, raising a RuntimeWarning is too much. Even if the check is only performed within (certain) channel types, I would only log to info.

cbrnr avatar Jun 04 '24 05:06 cbrnr