@@ -633,6 +633,7 @@ def init_single_subject_wf(
633633 all_estimators , estimator_map = map_fieldmap_estimation (
634634 layout = config .execution .layout ,
635635 subject_id = subject_id ,
636+ session_id = session_id ,
636637 bold_data = bold_runs ,
637638 ignore_fieldmaps = 'fieldmaps' in config .workflow .ignore ,
638639 use_syn = config .workflow .use_syn_sdc ,
@@ -834,6 +835,16 @@ def init_single_subject_wf(
834835 fieldmap_id = estimator_map .get (bold_file )
835836 jacobian = False
836837
838+ if len (bold_series ) == 2 :
839+ # This should only be reached if two-echo data are provided and echo-idx is not.
840+ # Raise an error in this case, until we figure out how to support two-echo data.
841+ bold_series_str = '\n \t ' .join (bold_series )
842+ raise RuntimeError (
843+ 'This BOLD series contains two echoes, which fMRIPrep does not support:\n '
844+ f'\t { bold_series_str } \n '
845+ 'Please set "--echo-idx" to process one echo at a time.'
846+ )
847+
837848 if fieldmap_id :
838849 if 'fmap-jacobian' in config .workflow .force :
839850 jacobian = True
@@ -933,6 +944,7 @@ def init_single_subject_wf(
933944def map_fieldmap_estimation (
934945 layout : bids .BIDSLayout ,
935946 subject_id : str ,
947+ session_id : str | list [str ] | None ,
936948 bold_data : list [list [str ]],
937949 ignore_fieldmaps : bool ,
938950 use_syn : bool | str ,
@@ -953,6 +965,7 @@ def map_fieldmap_estimation(
953965 fmap_estimators = find_estimators (
954966 layout = layout ,
955967 subject = subject_id ,
968+ sessions = [session_id ] if isinstance (session_id , str ) else session_id ,
956969 fmapless = bool (use_syn ) or (ignore_fieldmaps and force_syn ),
957970 force_fmapless = force_syn or (ignore_fieldmaps and use_syn ),
958971 bids_filters = filters ,
0 commit comments