Skip to content

ENH: Add in_argmax mode to better match older MaxFilter#14059

Open
larsoner wants to merge 8 commits into
mne-tools:mainfrom
larsoner:sss
Open

ENH: Add in_argmax mode to better match older MaxFilter#14059
larsoner wants to merge 8 commits into
mne-tools:mainfrom
larsoner:sss

Conversation

@larsoner

Copy link
Copy Markdown
Member

Finally chased down something that has bugged me for a while: why our regularization never really matched maxfilter's. Turns out that we are using the "new and improved" version based on a percentage threshold but the test files I generated many years ago used maxfilter 2.2, which used a (less good) information maximization mode. This PR

  1. Adds that mode 2.2-like processing (in case people want that compatibility mode) via regularize="in_argmax"
  2. Adds test files that use the 3.0 mode (showing we match to what we'd expect from MF using float32 -- some components are right near the threshold)
  3. Documents a bunch of constants better using paper refs, and asserts in tests that we match these
  4. Fixed some minor bugs with component on/off ordering (we should use the ordering that MF does) and with extracting rank if anyone has been using MaxFilter 3.0 (which I think is probably quite rare so far)

This was done with the help of Claude Opus 4.8, which ran a lot of tests with maxfilter, helped test my hypotheses about why our results might differ, and write initial code for updated tests etc. (which I then modified to be more MNE-style).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant