@@ -80,9 +80,6 @@ def init_infant_anat_wf(
80
80
"""
81
81
from nipype .interfaces .ants .base import Info as ANTsInfo
82
82
from niworkflows .engine .workflows import LiterateWorkflow as Workflow
83
- from sdcflows .workflows .ancillary import (
84
- init_brainextraction_wf as init_sdc_brain_extraction_wf ,
85
- )
86
83
87
84
from ...utils .misc import fix_multi_source_name
88
85
from .brain_extraction import (
@@ -270,31 +267,45 @@ def init_infant_anat_wf(
270
267
271
268
# fmt:off
272
269
wf .connect ([
273
- (inputnode , t1w_template_wf , [("t1w" , "inputnode.in_files " )]),
274
- (inputnode , t2w_template_wf , [("t2w" , "inputnode.in_files " )]),
270
+ (inputnode , t1w_template_wf , [("t1w" , "inputnode.anat_files " )]),
271
+ (inputnode , t2w_template_wf , [("t2w" , "inputnode.anat_files " )]),
275
272
(inputnode , anat_reports_wf , [("t1w" , "inputnode.source_file" )]),
276
273
(inputnode , coreg_report_wf , [("t1w" , "inputnode.source_file" )]),
277
274
(inputnode , anat_norm_wf , [(("t1w" , fix_multi_source_name ), "inputnode.orig_t1w" )]),
278
275
279
276
(t1w_template_wf , outputnode , [
280
- ("outputnode.realign_xfms" , "anat_ref_xfms" )]),
281
- (t1w_template_wf , t1w_preproc_wf , [("outputnode.out_file" , "inputnode.in_anat" )]),
282
- (t2w_template_wf , t2w_preproc_wf , [("outputnode.out_file" , "inputnode.in_anat" )]),
277
+ ("outputnode.anat_realign_xfm" , "anat_ref_xfms" )]),
278
+ (t1w_template_wf , t1w_preproc_wf , [("outputnode.anat_ref" , "inputnode.in_anat" )]),
283
279
(t1w_template_wf , anat_derivatives_wf , [
284
- ("outputnode.valid_list" , "inputnode.source_files" ),
285
- ("outputnode.realign_xfms" , "inputnode.t1w_ref_xfms" )]),
280
+ ("outputnode.anat_valid_list" , "inputnode.source_files" ),
281
+ ("outputnode.anat_realign_xfm" , "inputnode.t1w_ref_xfms" )]),
282
+ (t1w_template_wf , anat_reports_wf , [
283
+ ("outputnode.out_report" , "inputnode.t1w_conform_report" )]),
284
+
285
+ (t2w_template_wf , t2w_preproc_wf , [("outputnode.anat_ref" , "inputnode.in_anat" )]),
286
286
(t2w_template_wf , anat_derivatives_wf , [
287
- ("outputnode.valid_list " , "inputnode.t2w_source_files" )]),
287
+ ("outputnode.anat_valid_list " , "inputnode.t2w_source_files" )]),
288
288
289
289
(t1w_preproc_wf , coregistration_wf , [("outputnode.anat_preproc" , "inputnode.in_t1w" )]),
290
290
(t1w_preproc_wf , coreg_report_wf , [("outputnode.anat_preproc" , "inputnode.t1w_preproc" )]),
291
- (t1w_preproc_wf , anat_norm_wf , [
292
- ("outputnode.t1w_preproc" , "inputnode.moving_image" ),
293
- ("outputnode.t1w_mask" , "inputnode.moving_mask" )]),
294
291
295
292
(coregistration_wf , coreg_report_wf , [
296
293
("outputnode.t1w_mask" , "inputnode.in_mask" ),
297
294
("outputnode.t2w_preproc" , "inputnode.t2w_preproc" )]),
295
+ (coregistration_wf , anat_norm_wf , [
296
+ ("outputnode.t1w_preproc" , "inputnode.moving_image" ),
297
+ ("outputnode.t1w_mask" , "inputnode.moving_mask" )]),
298
+ (coregistration_wf , anat_seg_wf , [("outputnode.t1w_brain" , "inputnode.anat_brain" )]),
299
+ (coregistration_wf , anat_derivatives_wf , [
300
+ ("outputnode.t1w_mask" , "inputnode.t1w_mask" ),
301
+ ("outputnode.t1w_preproc" , "inputnode.t1w_preproc" ),
302
+ ("outputnode.t2w_preproc" , "inputnode.t2w_preproc" ),
303
+ ]),
304
+ (coregistration_wf , outputnode , [
305
+ ("outputnode.t1w_preproc" , "anat_preproc" ),
306
+ ("outputnode.t1w_brain" , "anat_brain" ),
307
+ ("outputnode.t1w_mask" , "anat_mask" ),
308
+ ]),
298
309
299
310
(anat_seg_wf , outputnode , [
300
311
("outputnode.anat_dseg" , "anat_dseg" ),
@@ -321,20 +332,6 @@ def init_infant_anat_wf(
321
332
("outputnode.anat2std_xfm" , "inputnode.anat2std_xfm" ),
322
333
("outputnode.std2anat_xfm" , "inputnode.std2anat_xfm" )]),
323
334
324
- (coregistration_wf , anat_seg_wf , [("outputnode.t1w_brain" , "inputnode.anat_brain" )]),
325
- (coregistration_wf , anat_derivatives_wf , [
326
- ("outputnode.t1w_mask" , "inputnode.t1w_mask" ),
327
- ("outputnode.t1w_preproc" , "inputnode.t1w_preproc" ),
328
- ("outputnode.t2w_preproc" , "inputnode.t2w_preproc" ),
329
- ]),
330
- (coregistration_wf , outputnode , [
331
- ("outputnode.t1w_preproc" , "anat_preproc" ),
332
- ("outputnode.t1w_brain" , "anat_brain" ),
333
- ("outputnode.t1w_mask" , "anat_mask" ),
334
- ]),
335
-
336
- (t1w_template_wf , anat_reports_wf , [
337
- ("outputnode.out_report" , "inputnode.t1w_conform_report" )]),
338
335
(outputnode , anat_reports_wf , [
339
336
("anat_preproc" , "inputnode.t1w_preproc" ),
340
337
("anat_mask" , "inputnode.t1w_mask" ),
@@ -347,9 +344,12 @@ def init_infant_anat_wf(
347
344
if precomp_mask :
348
345
# Ensure the mask is conformed along with the T1w
349
346
t1w_template_wf .inputs .inputnode .anat_mask = precomp_mask
347
+ # fmt:off
350
348
wf .connect ([
351
349
(t1w_template_wf , coregistration_wf , [("outputnode.anat_mask" , "inputnode.in_mask" )]),
350
+ (t2w_preproc_wf , coregistration_wf , [("outputnode.anat_preproc" , "inputnode.in_t2w" )])
352
351
])
352
+ # fmt:on
353
353
else :
354
354
# Run brain extraction on the T2w
355
355
brain_extraction_wf = init_infant_brain_extraction_wf (
@@ -361,7 +361,7 @@ def init_infant_anat_wf(
361
361
sloppy = sloppy ,
362
362
debug = "registration" in config .execution .debug ,
363
363
)
364
-
364
+ # fmt:off
365
365
wf .connect ([
366
366
(t1w_preproc_wf , brain_extraction_wf , [
367
367
("outputnode.anat_preproc" , "inputnode.in_t1w" )]),
@@ -372,13 +372,12 @@ def init_infant_anat_wf(
372
372
("outputnode.out_mask" , "inputnode.in_mask" ),
373
373
("outputnode.out_probmap" , "inputnode.in_probmap" )]),
374
374
])
375
+ # fmt:on
375
376
376
377
if precomp_aseg :
377
378
# Ensure the segmentation is conformed along with the T1w
378
379
t1w_template_wf .inputs .inputnode .anat_aseg = precomp_aseg
379
- wf .connect ([
380
- (t1w_template_wf , anat_seg_wf , [("outputnode.anat_aseg" , "inputnode.anat_aseg" )]),
381
- ])
380
+ wf .connect (t1w_template_wf , "outputnode.anat_aseg" , anat_seg_wf , "inputnode.anat_aseg" )
382
381
383
382
if not freesurfer :
384
383
return wf
@@ -411,7 +410,7 @@ def init_infant_anat_wf(
411
410
("outputnode.anat_aseg" , "inputnode.ants_segs" ),
412
411
]),
413
412
(t1w_template_wf , surface_recon_wf , [
414
- ("outputnode.out_file " , "inputnode.t1w" ),
413
+ ("outputnode.anat_ref " , "inputnode.t1w" ),
415
414
]),
416
415
(coregistration_wf , surface_recon_wf , [
417
416
("outputnode.t1w_brain" , "inputnode.skullstripped_t1" ),
0 commit comments