def get_mf_ctc_fname(subject, session): if config.mf_ctc_fname is None: mf_ctc_fpath = BIDSPath(subject=subject, session=session, suffix='meg', datatype='meg', root=config.bids_root).meg_crosstalk_fpath if mf_ctc_fpath is None: raise ValueError('Could not find Maxwell Filter cross-talk ' 'file.') else: mf_ctc_fpath = Path(config.mf_ctc_fname) if not mf_ctc_fpath.exists(): raise ValueError(f'Could not find Maxwell Filter cross-talk ' f'file at {str(mf_ctc_fpath)}.') return mf_ctc_fpath