@@ -300,29 +300,35 @@ def init_single_subject_wf(subject_id):
300
300
and a *b=0* average for reference to the subsequent steps of preprocessing was calculated.
301
301
"""
302
302
)
303
-
303
+ dwi_preproc_list = []
304
304
for dwi_file in subject_data ["dwi" ]:
305
305
dwi_preproc_wf = init_dwi_preproc_wf (dwi_file )
306
+ dwi_preproc_list .append (dwi_preproc_wf )
307
+
308
+ dwi_preproc_list_wf = pe .Node (niu .IdentityInterface (fields = ["dwi_workflows" ]),
309
+ name = "dwi_preproc_list_wf" )
310
+ dwi_preproc_list_wf .iterables = [("dwi_workflows" , dwi_preproc_list )]
306
311
307
- # fmt: off
308
- workflow .connect ([
309
- (anat_preproc_wf , dwi_preproc_wf ,
310
- [("outputnode.t1w_preproc" , "inputnode.t1w_preproc" ),
311
- ("outputnode.t1w_mask" , "inputnode.t1w_mask" ),
312
- ("outputnode.t1w_dseg" , "inputnode.t1w_dseg" ),
313
- ("outputnode.t1w_aseg" , "inputnode.t1w_aseg" ),
314
- ("outputnode.t1w_aparc" , "inputnode.t1w_aparc" ),
315
- ("outputnode.t1w_tpms" , "inputnode.t1w_tpms" ),
316
- ("outputnode.template" , "inputnode.template" ),
317
- ("outputnode.anat2std_xfm" , "inputnode.anat2std_xfm" ),
318
- ("outputnode.std2anat_xfm" , "inputnode.std2anat_xfm" ),
319
- # Undefined if --fs-no-reconall, but this is safe
320
- ("outputnode.subjects_dir" , "inputnode.subjects_dir" ),
321
- ("outputnode.t1w2fsnative_xfm" , "inputnode.t1w2fsnative_xfm" ),
322
- ("outputnode.fsnative2t1w_xfm" , "inputnode.fsnative2t1w_xfm" )]),
323
- (bids_info , dwi_preproc_wf , [("subject" , "inputnode.subject_id" )]),
324
- ])
325
- # fmt: on
312
+ # fmt: off
313
+ workflow .connect ([
314
+ (anat_preproc_wf , dwi_preproc_list_wf , [
315
+ ("outputnode.t1w_preproc" , "inputnode.t1w_preproc" ),
316
+ ("outputnode.t1w_mask" , "inputnode.t1w_mask" ),
317
+ ("outputnode.t1w_dseg" , "inputnode.t1w_dseg" ),
318
+ ("outputnode.t1w_aseg" , "inputnode.t1w_aseg" ),
319
+ ("outputnode.t1w_aparc" , "inputnode.t1w_aparc" ),
320
+ ("outputnode.t1w_tpms" , "inputnode.t1w_tpms" ),
321
+ ("outputnode.template" , "inputnode.template" ),
322
+ ("outputnode.anat2std_xfm" , "inputnode.anat2std_xfm" ),
323
+ ("outputnode.std2anat_xfm" , "inputnode.std2anat_xfm" ),
324
+ # Undefined if --fs-no-reconall, but this is safe
325
+ ("outputnode.subjects_dir" , "inputnode.subjects_dir" ),
326
+ ("outputnode.t1w2fsnative_xfm" , "inputnode.t1w2fsnative_xfm" ),
327
+ ("outputnode.fsnative2t1w_xfm" , "inputnode.fsnative2t1w_xfm" ),
328
+ ]),
329
+ (bids_info , dwi_preproc_list_wf , [("subject" , "inputnode.subject_id" )]),
330
+ ])
331
+ # fmt: on
326
332
327
333
if "fieldmap" in config .workflow .ignore :
328
334
return workflow
@@ -347,7 +353,16 @@ def init_single_subject_wf(subject_id):
347
353
output_dir = str (output_dir ),
348
354
subject = subject_id ,
349
355
)
350
-
356
+ # fmt: off
357
+ workflow .connect ([
358
+ (fmap_wf , dwi_preproc_list_wf , [
359
+ ("outputnode.fmap" , "inputnode.fmap" ),
360
+ ("outputnode.fmap_ref" , "inputnode.fmap_ref" ),
361
+ ("outputnode.fmap_coeff" , "inputnode.fmap_coeff" ),
362
+ ("outputnode.fmap_mask" , "inputnode.fmap_mask" ),
363
+ ]),
364
+ ])
365
+ # fmt: on
351
366
# Overwrite ``out_path_base`` of sdcflows's DataSinks
352
367
for node in fmap_wf .list_node_names ():
353
368
if node .split ("." )[- 1 ].startswith ("ds_" ):
0 commit comments