|
23 | 23 | from ..._logging import gen_log_kwargs, logger |
24 | 24 | from ..._parallel import get_parallel_backend, parallel_func |
25 | 25 | from ..._report import _open_report, _render_bem |
26 | | -from ..._run import _prep_out_files, failsafe_run, save_logs |
| 26 | +from ..._run import _prep_out_files, _sanitize_callable, failsafe_run, save_logs |
27 | 27 |
|
28 | 28 |
|
29 | 29 | def _prepare_trans_template( |
@@ -102,7 +102,18 @@ def get_input_fnames_forward(*, cfg, subject, session): |
102 | 102 | check=False, |
103 | 103 | ) |
104 | 104 | in_files = dict() |
105 | | - in_files["info"] = bids_path.copy().update(**cfg.source_info_path_update) |
| 105 | + # for consistency with 05_make_inverse, read the info from the |
| 106 | + # data used for the noise_cov |
| 107 | + if cfg.source_info_path_update is None: |
| 108 | + if cfg.noise_cov in ("rest", "noise"): |
| 109 | + source_info_path_update = dict( |
| 110 | + processing="clean", suffix="raw", task=cfg.noise_cov |
| 111 | + ) |
| 112 | + else: |
| 113 | + source_info_path_update = dict(suffix="ave") |
| 114 | + else: |
| 115 | + source_info_path_update = cfg.source_info_path_update |
| 116 | + in_files["info"] = bids_path.copy().update(**source_info_path_update) |
106 | 117 | bem_path = cfg.fs_subjects_dir / cfg.fs_subject / "bem" |
107 | 118 | _, tag = _get_bem_conductivity(cfg) |
108 | 119 | in_files["bem"] = bem_path / f"{cfg.fs_subject}-{tag}-bem-sol.fif" |
@@ -242,6 +253,7 @@ def get_config( |
242 | 253 | use_template_mri=config.use_template_mri, |
243 | 254 | adjust_coreg=config.adjust_coreg, |
244 | 255 | source_info_path_update=config.source_info_path_update, |
| 256 | + noise_cov=_sanitize_callable(config.noise_cov), |
245 | 257 | ch_types=config.ch_types, |
246 | 258 | fs_subject=get_fs_subject(config=config, subject=subject), |
247 | 259 | fs_subjects_dir=get_fs_subjects_dir(config), |
|
0 commit comments