From aaab0232570b75d6d7f1f8cb88e07a1ed14e6525 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 29 Oct 2024 16:49:00 -0400 Subject: [PATCH] BUG: Fix bug with forward creation (#1014) --- docs/source/v1.10.md.inc | 2 ++ mne_bids_pipeline/steps/source/_04_make_forward.py | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/source/v1.10.md.inc b/docs/source/v1.10.md.inc index 282a98a50..c2be004cc 100644 --- a/docs/source/v1.10.md.inc +++ b/docs/source/v1.10.md.inc @@ -22,6 +22,8 @@ 1. Emptyroom files that lack cHPI channels will now be processed (for line noise only) instead of raising an error. 2. cHPI filtering is now performed before movement compensation. +- Fix bug where the ``config.proc`` parameter was not used properly during forward model creation (#1014 by @larsoner) + ### :books: Documentation - Choose the theme (dark of light) automatically based on the user's operating system setting (#979 by @hoechenberger) diff --git a/mne_bids_pipeline/steps/source/_04_make_forward.py b/mne_bids_pipeline/steps/source/_04_make_forward.py index 25870a822..ee2111509 100644 --- a/mne_bids_pipeline/steps/source/_04_make_forward.py +++ b/mne_bids_pipeline/steps/source/_04_make_forward.py @@ -81,7 +81,12 @@ def _prepare_trans_subject( logger.info(**gen_log_kwargs(message=msg)) trans = get_head_mri_trans( - bids_path.copy().update(run=cfg.runs[0], root=cfg.bids_root, extension=None), + bids_path.copy().update( + run=cfg.runs[0], + root=cfg.bids_root, + processing=cfg.proc, + extension=None, + ), t1_bids_path=cfg.t1_bids_path, fs_subject=cfg.fs_subject, fs_subjects_dir=cfg.fs_subjects_dir, @@ -138,6 +143,9 @@ def run_forward( session: str | None, in_files: dict, ) -> dict: + # Do not use processing=cfg.proc here because the forward could actually be + # influenced by previous steps (e.g., Maxwell filtering), so just make sure we + # use cfg.proc when figuring out the head<->MRI transform bids_path = BIDSPath( subject=subject, session=session,