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

Use cleaned epochs for sensor-space decoding, time-frequency analysis, and covariance calculation #796

Merged
merged 13 commits into from
Oct 30, 2023
Merged
4 changes: 4 additions & 0 deletions docs/source/v1.5.md.inc
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## v1.5.0 (unreleased)

This release contains a number of very important bug fixes that address problems related to decoding, time-frequency analysis, and even inverse modeling.
hoechenberger marked this conversation as resolved.
Show resolved Hide resolved
All users are encouraged to update.

### :new: New features & enhancements

- Added `deriv_root` argument to CLI (#773 by @vferat)
Expand Down Expand Up @@ -30,3 +33,4 @@
- Fixed bug with parallelization across runs for Maxwell filtering (#761 by @larsoner)
- Fixed bug where head position files were not written with a proper suffix and extension (#761 by @larsoner)
- Fixed bug where default values for `decoding_csp_times` and `decoding_csp_freqs` were not set dynamically based on the config parameters (#779 by @larsoner)
- A number of processing steps errorneously always operated on un-cleaned epochs (`sensor/decoding_full_epochs`, `sensor/decoding_time_by_time`, `sensor/decoding_csp`), or operated on un-cleaned epochs (without PTP rejection) if not ICA or SSP was requested (`sensor/ime_frequency`, `sensor/make_cov`). The bug in `sensor/make_cov` could propagate to the source level as the covariance matrix is used for inverse modeling. (#796 by @hoechenberger)
1 change: 1 addition & 0 deletions mne_bids_pipeline/steps/sensor/_02_decoding_full_epochs.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def get_input_fnames_epochs_decoding(
run=None,
recording=cfg.rec,
space=cfg.space,
processing="clean",
suffix="epo",
extension=".fif",
datatype=cfg.datatype,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def get_input_fnames_time_decoding(
run=None,
recording=cfg.rec,
space=cfg.space,
processing="clean",
suffix="epo",
extension=".fif",
datatype=cfg.datatype,
Expand Down
5 changes: 1 addition & 4 deletions mne_bids_pipeline/steps/sensor/_04_time_frequency.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ def get_input_fnames_time_frequency(
subject: str,
session: Optional[str],
) -> dict:
processing = None
if cfg.spatial_filter is not None:
processing = "clean"
fname_epochs = BIDSPath(
subject=subject,
session=session,
Expand All @@ -46,7 +43,7 @@ def get_input_fnames_time_frequency(
space=cfg.space,
datatype=cfg.datatype,
root=cfg.deriv_root,
processing=processing,
processing="clean",
suffix="epo",
extension=".fif",
check=False,
Expand Down
1 change: 1 addition & 0 deletions mne_bids_pipeline/steps/sensor/_05_decoding_csp.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ def get_input_fnames_csp(
run=None,
recording=cfg.rec,
space=cfg.space,
processing="clean",
suffix="epo",
extension=".fif",
datatype=cfg.datatype,
Expand Down
3 changes: 1 addition & 2 deletions mne_bids_pipeline/steps/sensor/_06_make_cov.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ def get_input_fnames_cov(
) -> dict:
cov_type = _get_cov_type(cfg)
in_files = dict()
processing = "clean" if cfg.spatial_filter is not None else None
fname_epochs = BIDSPath(
subject=subject,
session=session,
Expand All @@ -48,7 +47,7 @@ def get_input_fnames_cov(
space=cfg.space,
extension=".fif",
suffix="epo",
processing=processing,
processing="clean",
datatype=cfg.datatype,
root=cfg.deriv_root,
check=False,
Expand Down