assert (len(t1ws) > 0), "No T1w files found for subject %s!" % subject_label assert (len(t2ws) > 0), "No T2w files found for subject %s!" % subject_label available_resolutions = ["0.7", "0.8", "1"] t1_zooms = nibabel.load(t1ws[0]).get_header().get_zooms() t1_res = float(min(t1_zooms[:3])) t1_template_res = min(available_resolutions, key=lambda x: abs(float(x) - t1_res)) t2_zooms = nibabel.load(t2ws[0]).get_header().get_zooms() t2_res = float(min(t2_zooms[:3])) t2_template_res = min(available_resolutions, key=lambda x: abs(float(x) - t2_res)) fieldmap_set = layout.get_fieldmap(t1ws[0], return_list=True) fmap_args = { "fmapmag": "NONE", "fmapphase": "NONE", "echodiff": "NONE", "t1samplespacing": "NONE", "t2samplespacing": "NONE", "unwarpdir": "NONE", "avgrdcmethod": "NONE", "SEPhaseNeg": "NONE", "SEPhasePos": "NONE", "echospacing": "NONE", "seunwarpdir": "NONE" } if fieldmap_set: