Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When reading FIFF files, "allow Maxshield" by default #788

Merged
merged 2 commits into from
May 1, 2021

Conversation

hoechenberger
Copy link
Member

@hoechenberger hoechenberger commented Apr 30, 2021

In main, when trying to read a FIFF file that was recorded with activated Maxshield and hasn't been Maxwell-filtered yet, one needed to explicitly pass extra_params=dict(allow_maxshield=True) to read_raw_bids().

However, since we currently only support reading and writing "raw" data properly (i.e., no derivatives), this unncessarily complicates things: raw data is often not Maxwell-filtered, and Maxwell-filtering is one of the very first processing steps after loading the data. In contrast, IF the data was already Maxwell-filtered on the device, this would be clearly recognizable by its proc entity, which should indicate such processing, making any further complications just for the sake of "making users aware they need to Maxwell-filter" a bit pointless.

So this commit makes it such that FIFF files will be read with allow_maxshield=True by default, unless explicitly disabled via e.g. extra_params=dict(allow_maxshield=False).

I also removed the --allow_maxshield switch from the raw_to_bids command, as this seems similarly superfluous and is not in line with how write_raw_bids() handles things (auto-sets allow_maxshield=True)

Merge checklist

Maintainer, please confirm the following before merging:

  • All comments resolved
  • This is not your own PR
  • All CIs are happy
  • PR title starts with [MRG]
  • whats_new.rst is updated
  • PR description includes phrase "closes <#issue-number>"

In `main`, when trying to read a FIFF file that was recorded with
activated Maxshield and hasn't been Maxwell-filtered yet, one
needed to explicitly pass `extra_params=dict(allow_maxshield=True)`
to `read_raw_bids()`.

However, since we currently only support reading and writing "raw"
data properly (i.e., no derivatives), this unncessarily complicates
things: raw data is often not Maxwell-filtered, and Maxwell-filtering is
one of the very first processing steps after loading the data. In
contrast, IF the data was already Maxwell-filtered on the device, this
would be clearly recognizible by its `proc` entity, which should
indicate such processing.

So this commit makes it such that FIFF files will be read with
`allow_maxshield=True` by default, unless explicitly disabled
via e.g. `extra_params=dict(allow_maxshield=False)`.

It also removed the `--allow_maxshield` switch from the
`raw_to_bids` command, as this seems similarly superfluous
and is not in line with how `write_raw_bids()` handles things.
@codecov-commenter
Copy link

codecov-commenter commented Apr 30, 2021

Codecov Report

Merging #788 (00900c3) into main (9e55a89) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #788   +/-   ##
=======================================
  Coverage   94.19%   94.20%           
=======================================
  Files          23       23           
  Lines        2948     2952    +4     
=======================================
+ Hits         2777     2781    +4     
  Misses        171      171           
Impacted Files Coverage Δ
mne_bids/commands/mne_bids_raw_to_bids.py 94.59% <100.00%> (+0.30%) ⬆️
mne_bids/read.py 97.38% <100.00%> (+0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9e55a89...00900c3. Read the comment docs.

Copy link
Member

@sappelhoff sappelhoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am impartial on this, I you both think it's an improvement I'll trust your choice 👍

@agramfort agramfort merged commit 12815db into mne-tools:main May 1, 2021
@hoechenberger hoechenberger deleted the maxshield branch May 1, 2021 08:22
hoechenberger added a commit to hoechenberger/mne-bids-pipeline that referenced this pull request May 1, 2021
It's superfluous now that mne-tools/mne-bids#788
has been merged.
agramfort pushed a commit to mne-tools/mne-bids-pipeline that referenced this pull request May 1, 2021
* Drop allow_maxshield config option

It's superfluous now that mne-tools/mne-bids#788
has been merged.

* Forgot something
@SophieHerbst
Copy link
Contributor

A bit late to the party, sorry.
I think it would still be good to issue a warning when loading data recorded with Maxshield on to remind the user to apply maxfilter.

@hoechenberger
Copy link
Member Author

I think MNE issues a warning nevertheless. Now I'm wondering why we don't see this in our tests 🤔

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.

5 participants