@@ -267,6 +267,7 @@ def init_infant_anat_wf(
267
267
# fmt:off
268
268
wf .connect ([
269
269
(inputnode , t1w_template_wf , [("t1w" , "inputnode.in_files" )]),
270
+ (inputnode , t2w_template_wf , [("t2w" , "inputnode.in_files" )]),
270
271
(t1w_template_wf , outputnode , [
271
272
("outputnode.realign_xfms" , "anat_ref_xfms" ),
272
273
]),
@@ -298,49 +299,6 @@ def init_infant_anat_wf(
298
299
("outputnode.t1w_mask" , "inputnode.t1w_mask" ),
299
300
("outputnode.t1w_preproc" , "inputnode.t1w_preproc" ),
300
301
]),
301
- (coregistration_wf , anat_derivatives_wf , [
302
- ("outputnode.t2w_preproc" , "inputnode.t2w_preproc" )
303
- ]),
304
- (t1w_preproc_wf , outputnode , [
305
- ("outputnode.t1w_preproc" , "anat_preproc" ),
306
- ("outputnode.t1w_brain" , "anat_brain" ),
307
- ("outputnode.t1w_mask" , "anat_mask" ),
308
- ]),
309
- ])
310
-
311
- if not precomp_aseg :
312
- wf .connect ([
313
- (t1w_preproc_wf , anat_seg_wf , [("outputnode.t1w_brain" , "inputnode.anat_brain" )]),
314
- ])
315
- wf .connect ([
316
- (inputnode , t2w_template_wf , [("t2w" , "inputnode.in_files" )]),
317
- ])
318
- if precomp_mask :
319
- wf .connect ([
320
- (t1w_template_wf , precomp_mask_wf , [
321
- ("outputnode.out_file" , "inputnode.t1w" ),
322
- ]),
323
- (t2w_template_wf , sdc_brain_extraction_wf , [
324
- ("outputnode.out_file" , "inputnode.in_file" ),
325
- ]),
326
- (sdc_brain_extraction_wf , coregistration_wf , [
327
- ("outputnode.out_file" , "inputnode.in_t2w_preproc" ),
328
- ("outputnode.out_mask" , "inputnode.in_mask" ),
329
- ("outputnode.out_probseg" , "inputnode.in_probmap" ),
330
- ]),
331
- ])
332
- else :
333
- wf .connect ([
334
- (t2w_template_wf , brain_extraction_wf , [
335
- ("outputnode.out_file" , "inputnode.in_t2w" ),
336
- ]),
337
- (brain_extraction_wf , coregistration_wf , [
338
- ("outputnode.t2w_preproc" , "inputnode.in_t2w_preproc" ),
339
- ("outputnode.out_mask" , "inputnode.in_mask" ),
340
- ("outputnode.out_probmap" , "inputnode.in_probmap" ),
341
- ]),
342
- ])
343
- wf .connect ([
344
302
(t1w_template_wf , coregistration_wf , [
345
303
("outputnode.out_file" , "inputnode.in_t1w" ),
346
304
]),
@@ -355,9 +313,14 @@ def init_infant_anat_wf(
355
313
(coregistration_wf , coreg_report_wf , [
356
314
("outputnode.t2w_preproc" , "inputnode.t2w_preproc" )
357
315
]),
358
- ])
359
-
360
- wf .connect ([
316
+ (coregistration_wf , anat_derivatives_wf , [
317
+ ("outputnode.t2w_preproc" , "inputnode.t2w_preproc" )
318
+ ]),
319
+ (t1w_preproc_wf , outputnode , [
320
+ ("outputnode.t1w_preproc" , "anat_preproc" ),
321
+ ("outputnode.t1w_brain" , "anat_brain" ),
322
+ ("outputnode.t1w_mask" , "anat_mask" ),
323
+ ]),
361
324
# reports
362
325
(inputnode , anat_reports_wf , [
363
326
("t1w" , "inputnode.source_file" ),
@@ -396,6 +359,33 @@ def init_infant_anat_wf(
396
359
("outputnode.anat_tpms" , "inputnode.t1w_tpms" ),
397
360
]),
398
361
])
362
+
363
+ if precomp_mask :
364
+ wf .connect ([
365
+ (t1w_template_wf , precomp_mask_wf , [
366
+ ("outputnode.out_file" , "inputnode.t1w" ),
367
+ ]),
368
+ (t2w_template_wf , sdc_brain_extraction_wf , [
369
+ ("outputnode.out_file" , "inputnode.in_file" ),
370
+ ]),
371
+ (sdc_brain_extraction_wf , coregistration_wf , [
372
+ ("outputnode.out_file" , "inputnode.in_t2w_preproc" ),
373
+ ("outputnode.out_mask" , "inputnode.in_mask" ),
374
+ ("outputnode.out_probseg" , "inputnode.in_probmap" ),
375
+ ]),
376
+ ])
377
+ else :
378
+ wf .connect ([
379
+ (t2w_template_wf , brain_extraction_wf , [
380
+ ("outputnode.out_file" , "inputnode.in_t2w" ),
381
+ ]),
382
+ (brain_extraction_wf , coregistration_wf , [
383
+ ("outputnode.t2w_preproc" , "inputnode.in_t2w_preproc" ),
384
+ ("outputnode.out_mask" , "inputnode.in_mask" ),
385
+ ("outputnode.out_probmap" , "inputnode.in_probmap" ),
386
+ ]),
387
+ (t1w_preproc_wf , anat_seg_wf , [("outputnode.t1w_brain" , "inputnode.anat_brain" )]),
388
+ ])
399
389
# fmt:on
400
390
401
391
if not freesurfer :
0 commit comments