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

BUG: Fix bug with forward creation #1014

Merged
merged 2 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/source/v1.10.md.inc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,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)
Expand Down
10 changes: 9 additions & 1 deletion mne_bids_pipeline/steps/source/_04_make_forward.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -136,6 +141,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,
Expand Down