diff --git a/aslprep/interfaces/cbf.py b/aslprep/interfaces/cbf.py index e408e8ded..d364a011d 100644 --- a/aslprep/interfaces/cbf.py +++ b/aslprep/interfaces/cbf.py @@ -87,7 +87,7 @@ class _ExtractCBFInputSpec(BaseInterfaceInputSpec): m0scan = traits.Either( File(exists=True), None, - mandatory=True, + mandatory=False, desc="m0scan file associated with the ASL file. Only defined if M0Type is 'Separate'.", ) m0scan_metadata = traits.Either( diff --git a/aslprep/workflows/asl/util.py b/aslprep/workflows/asl/util.py index 61f1a8139..b1abc00fb 100644 --- a/aslprep/workflows/asl/util.py +++ b/aslprep/workflows/asl/util.py @@ -250,21 +250,17 @@ def init_validate_asl_wf(asl_file=None, name="validate_asl_wf"): asl_1st = pe.Node(niu.Select(index=[0]), name="asl_1st", run_without_submitting=True) - # fmt:off workflow.connect([ (val_asl, asl_1st, [(("out_file", listify), "inlist")]), (asl_1st, outputnode, [("out", "asl_file")]), - ]) - # fmt:on + ]) # fmt:skip validate_1st = pe.Node(niu.Select(index=[0]), name="validate_1st", run_without_submitting=True) - # fmt:off workflow.connect([ (val_asl, validate_1st, [(("out_report", listify), "inlist")]), (validate_1st, outputnode, [("out", "validation_report")]), - ]) - # fmt:on + ]) # fmt:skip return workflow @@ -403,14 +399,12 @@ def init_asl_reference_wf( name="select_reference_volumes", ) - # fmt:off workflow.connect([ (inputnode, select_reference_volumes, [ ("asl_file", "asl_file"), ("aslcontext", "aslcontext"), ]), - ]) - # fmt:on + ]) # fmt:skip val_asl = pe.MapNode( ValidateImage(), @@ -423,19 +417,16 @@ def init_asl_reference_wf( gen_ref = pe.Node(EstimateReferenceImage(), name="gen_ref", mem_gb=1) - # fmt:off workflow.connect([ (val_asl, gen_ref, [("out_file", "in_file")]), (gen_ref, outputnode, [ ("ref_image", "raw_ref_image"), ("n_volumes_to_discard", "algo_dummy_scans"), ]), - ]) - # fmt:on + ]) # fmt:skip enhance_and_skullstrip_asl_wf = init_enhance_and_skullstrip_asl_wf(pre_mask=pre_mask) - # fmt:off workflow.connect([ (inputnode, enhance_and_skullstrip_asl_wf, [("asl_mask", "inputnode.pre_mask")]), (gen_ref, enhance_and_skullstrip_asl_wf, [("ref_image", "inputnode.in_file")]), @@ -444,8 +435,7 @@ def init_asl_reference_wf( ("outputnode.mask_file", "asl_mask"), ("outputnode.skull_stripped_file", "ref_image_brain"), ]), - ]) - # fmt:on + ]) # fmt:skip calc_dummy_scans = pe.Node( niu.Function(function=pass_dummy_scans, output_names=["skip_vols_num"]), @@ -453,22 +443,18 @@ def init_asl_reference_wf( run_without_submitting=True, mem_gb=DEFAULT_MEMORY_MIN_GB, ) - # fmt:off workflow.connect([ (inputnode, calc_dummy_scans, [("dummy_scans", "dummy_scans")]), (gen_ref, calc_dummy_scans, [("n_volumes_to_discard", "algo_dummy_scans")]), (calc_dummy_scans, outputnode, [("skip_vols_num", "skip_vols")]), - ]) - # fmt:on + ]) # fmt:skip asl_1st = pe.Node(niu.Select(index=[0]), name="asl_1st", run_without_submitting=True) - # fmt:off workflow.connect([ (val_asl, asl_1st, [(("out_file", listify), "inlist")]), (asl_1st, outputnode, [("out", "asl_file")]), - ]) - # fmt:on + ]) # fmt:skip validate_1st = pe.Node(niu.Select(index=[0]), name="validate_1st", run_without_submitting=True) diff --git a/aslprep/workflows/base.py b/aslprep/workflows/base.py index 901e008e8..1dafcfe1a 100644 --- a/aslprep/workflows/base.py +++ b/aslprep/workflows/base.py @@ -512,13 +512,11 @@ def init_single_subject_wf(subject_id: str): run_without_submitting=True, ) if any(estimator.method == fm.EstimatorType.ANAT for estimator in fmap_estimators): - # fmt:off workflow.connect([ (anat_fit_wf, fmap_select_std, [ ("outputnode.std2anat_xfm", "std2anat_xfm"), ("outputnode.template", "keys")]), - ]) - # fmt:on + ]) # fmt:skip for estimator in fmap_estimators: config.loggers.workflow.info( @@ -564,7 +562,6 @@ def init_single_subject_wf(subject_id: str): syn_preprocessing_wf.inputs.inputnode.in_epis = sources syn_preprocessing_wf.inputs.inputnode.in_meta = source_meta - # fmt:off workflow.connect([ (anat_fit_wf, syn_preprocessing_wf, [ ("outputnode.t1w_preproc", "inputnode.in_anat"), @@ -580,8 +577,7 @@ def init_single_subject_wf(subject_id: str): ("outputnode.anat_mask", f"in_{estimator.bids_id}.anat_mask"), ("outputnode.sd_prior", f"in_{estimator.bids_id}.sd_prior"), ]), - ]) - # fmt:on + ]) # fmt:skip # Append the functional section to the existing anatomical excerpt # That way we do not need to stream down the number of asl datasets