From 9e256fbdc17b0aa7bf0eea30831d1c9075fbfbf6 Mon Sep 17 00:00:00 2001 From: Daniel McCloy Date: Wed, 31 Jul 2024 13:38:45 -0500 Subject: [PATCH] allow emptyroom match to vary by session (#976) --- docs/source/v1.10.md.inc | 2 ++ .../steps/init/_02_find_empty_room.py | 21 +++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/docs/source/v1.10.md.inc b/docs/source/v1.10.md.inc index 2a73664e8..ac6fd1c8f 100644 --- a/docs/source/v1.10.md.inc +++ b/docs/source/v1.10.md.inc @@ -14,6 +14,8 @@ ### :bug: Bug fixes +- Empty room matching is now done for all sessions (previously only for the first session) for each subject. (#976 by @drammock) + - When running the pipeline with [`mf_filter_chpi`][mne_bids_pipeline._config.mf_filter_chpi] enabled (#977 by @drammock and @larsoner): 1. Emptyroom files that lack cHPI channels will now be processed (for line noise only) instead of raising an error. diff --git a/mne_bids_pipeline/steps/init/_02_find_empty_room.py b/mne_bids_pipeline/steps/init/_02_find_empty_room.py index 02d1f9d06..42826657f 100644 --- a/mne_bids_pipeline/steps/init/_02_find_empty_room.py +++ b/mne_bids_pipeline/steps/init/_02_find_empty_room.py @@ -128,16 +128,15 @@ def main(*, config) -> None: # in parallel. logs = list() for subject in get_subjects(config): - run = get_mf_reference_run(config=config) - logs.append( - find_empty_room( - cfg=get_config( - config=config, - ), - exec_params=config.exec_params, - subject=subject, - session=get_sessions(config)[0], - run=run, + for session in get_sessions(config): + run = get_mf_reference_run(config=config) + logs.append( + find_empty_room( + cfg=get_config(config=config), + exec_params=config.exec_params, + subject=subject, + session=session, + run=run, + ) ) - ) save_logs(config=config, logs=logs)