@@ -346,10 +346,9 @@ def init_func_preproc_wf(bold_file, has_fieldmap=False, existing_derivatives=Non
346
346
outputnode = pe .Node (
347
347
niu .IdentityInterface (
348
348
fields = [
349
+ "anat2bold_xfm" ,
349
350
"bold_anat" ,
350
351
"bold_anat_ref" ,
351
- "bold2anat_xfm" ,
352
- "anat2bold_xfm" ,
353
352
"bold_mask_anat" ,
354
353
"bold_aseg_anat" ,
355
354
"bold_aparc_anat" ,
@@ -363,6 +362,7 @@ def init_func_preproc_wf(bold_file, has_fieldmap=False, existing_derivatives=Non
363
362
"bold_mask_native" ,
364
363
"bold_echos_native" ,
365
364
"bold_cifti" ,
365
+ "bold2anat_xfm" ,
366
366
"cifti_variant" ,
367
367
"cifti_metadata" ,
368
368
"cifti_density" ,
@@ -433,6 +433,7 @@ def init_func_preproc_wf(bold_file, has_fieldmap=False, existing_derivatives=Non
433
433
('bold_anat_ref' , 'inputnode.bold_t1_ref' ),
434
434
('bold2anat_xfm' , 'inputnode.bold2anat_xfm' ),
435
435
('anat2bold_xfm' , 'inputnode.anat2bold_xfm' ),
436
+ ('hmc_xforms' , 'inputnode.hmc_xforms' ),
436
437
('bold_aseg_anat' , 'inputnode.bold_aseg_t1' ),
437
438
('bold_aparc_anat' , 'inputnode.bold_aparc_t1' ),
438
439
('bold_mask_anat' , 'inputnode.bold_mask_t1' ),
@@ -449,6 +450,9 @@ def init_func_preproc_wf(bold_file, has_fieldmap=False, existing_derivatives=Non
449
450
('cifti_variant' , 'inputnode.cifti_variant' ),
450
451
('cifti_metadata' , 'inputnode.cifti_metadata' ),
451
452
('cifti_density' , 'inputnode.cifti_density' ),
453
+ ('t2star_bold' , 'inputnode.t2star_bold' ),
454
+ ('t2star_t1' , 'inputnode.t2star_t1' ),
455
+ ('t2star_std' , 'inputnode.t2star_std' ),
452
456
('confounds_metadata' , 'inputnode.confounds_metadata' ),
453
457
('acompcor_masks' , 'inputnode.acompcor_masks' ),
454
458
('tcompcor_mask' , 'inputnode.tcompcor_mask' ),
@@ -548,7 +552,8 @@ def init_func_preproc_wf(bold_file, has_fieldmap=False, existing_derivatives=Non
548
552
)
549
553
550
554
bold_final = pe .Node (
551
- niu .IdentityInterface (fields = ["bold" , "boldref" , "mask" , "bold_echos" ]), name = "bold_final"
555
+ niu .IdentityInterface (fields = ["bold" , "boldref" , "mask" , "bold_echos" , "t2star" ]),
556
+ name = "bold_final" ,
552
557
)
553
558
554
559
# Mask input BOLD reference image
@@ -580,6 +585,9 @@ def init_func_preproc_wf(bold_file, has_fieldmap=False, existing_derivatives=Non
580
585
('bold_ref' , 'inputnode.raw_ref_image' )]),
581
586
(validate_bolds , bold_hmc_wf , [
582
587
(("out_file" , pop_file ), 'inputnode.bold_file' )]),
588
+ (bold_hmc_wf , outputnode , [
589
+ ("outputnode.xforms" , "hmc_xforms" ),
590
+ ]),
583
591
# Native-space BOLD files
584
592
(final_boldref_wf , final_boldref_mask , [('outputnode.epi_ref_file' , 'in_file' )]),
585
593
(final_boldref_wf , bold_final , [('outputnode.epi_ref_file' , 'boldref' )]),
@@ -589,6 +597,7 @@ def init_func_preproc_wf(bold_file, has_fieldmap=False, existing_derivatives=Non
589
597
('boldref' , 'bold_native_ref' ),
590
598
('mask' , 'bold_mask_native' ),
591
599
('bold_echos' , 'bold_echos_native' ),
600
+ ('t2star' , 't2star_bold' ),
592
601
]),
593
602
# EPI-T1 registration workflow
594
603
(inputnode , bold_reg_wf , [
@@ -668,15 +677,22 @@ def init_func_preproc_wf(bold_file, has_fieldmap=False, existing_derivatives=Non
668
677
workflow .connect ([
669
678
# update name source for optimal combination
670
679
(inputnode , func_derivatives_wf , [
671
- (('bold_file' , combine_meepi_source ), 'inputnode.source_file' )]),
672
- (join_echos , bold_t2s_wf , [
673
- ('bold_files' , 'inputnode.bold_file' )]),
674
- (bold_t2s_wf , split_opt_comb , [
675
- ('outputnode.bold' , 'in_file' )]),
676
- (split_opt_comb , bold_t1_trans_wf , [
677
- ("out_files" , "inputnode.bold_split" )]),
680
+ (("bold_file" , combine_meepi_source ), "inputnode.source_file" ),
681
+ ]),
682
+ (join_echos , bold_t2s_wf , [("bold_files" , "inputnode.bold_file" )]),
678
683
(join_echos , bold_final , [("bold_files" , "bold_echos" )]),
679
- (bold_t2s_wf , bold_final , [("outputnode.bold" , "bold" )]),
684
+ (bold_t2s_wf , split_opt_comb , [("outputnode.bold" , "in_file" )]),
685
+ (split_opt_comb , bold_t1_trans_wf , [("out_files" , "inputnode.bold_split" )]),
686
+ (bold_t2s_wf , bold_final , [("outputnode.bold" , "bold" ),
687
+ ("outputnode.t2star_map" , "t2star" )]),
688
+ (inputnode , t2s_reporting_wf , [("anat_dseg" , "inputnode.label_file" )]),
689
+ (bold_reg_wf , t2s_reporting_wf , [
690
+ ("outputnode.itk_t1_to_bold" , "inputnode.label_bold_xform" )
691
+ ]),
692
+ (bold_final , t2s_reporting_wf , [("t2star" , "inputnode.t2star_file" ),
693
+ ("boldref" , "inputnode.boldref" )]),
694
+ (t2s_reporting_wf , ds_report_t2scomp , [('outputnode.t2s_comp_report' , 'in_file' )]),
695
+ (t2s_reporting_wf , ds_report_t2star_hist , [("outputnode.t2star_hist" , "in_file" )]),
680
696
])
681
697
# fmt:on
682
698
@@ -704,6 +720,23 @@ def init_func_preproc_wf(bold_file, has_fieldmap=False, existing_derivatives=Non
704
720
])
705
721
# fmt:on
706
722
723
+ if multiecho :
724
+ t2star_to_t1w = pe .Node (
725
+ ApplyTransforms (interpolation = "LanczosWindowedSinc" , float = True ),
726
+ name = "t2star_to_t1w" ,
727
+ mem_gb = 0.1 ,
728
+ )
729
+ # fmt:off
730
+ workflow .connect ([
731
+ (bold_reg_wf , t2star_to_t1w , [("outputnode.itk_bold_to_t1" , "transforms" )]),
732
+ (bold_t1_trans_wf , t2star_to_t1w , [
733
+ ("outputnode.bold_mask_t1" , "reference_image" )
734
+ ]),
735
+ (bold_final , t2star_to_t1w , [("t2star" , "input_image" )]),
736
+ (t2star_to_t1w , outputnode , [("output_image" , "t2star_t1" )]),
737
+ ])
738
+ # fmt:on
739
+
707
740
if spaces .get_spaces (nonstandard = False , dim = (3 ,)):
708
741
# Apply transforms in 1 shot
709
742
# Only use uncompressed output if AROMA is to be run
@@ -712,6 +745,7 @@ def init_func_preproc_wf(bold_file, has_fieldmap=False, existing_derivatives=Non
712
745
mem_gb = mem_gb ["resampled" ],
713
746
omp_nthreads = omp_nthreads ,
714
747
spaces = spaces ,
748
+ multiecho = multiecho ,
715
749
name = "bold_std_trans_wf" ,
716
750
use_compression = not config .execution .low_mem ,
717
751
)
@@ -727,6 +761,7 @@ def init_func_preproc_wf(bold_file, has_fieldmap=False, existing_derivatives=Non
727
761
('anat_aparc' , 'inputnode.bold_aparc' )]),
728
762
(bold_final , bold_std_trans_wf , [
729
763
('mask' , 'inputnode.bold_mask' ),
764
+ ('t2star' , 'inputnode.t2star' ),
730
765
]),
731
766
(bold_reg_wf , bold_std_trans_wf , [
732
767
('outputnode.itk_bold_to_t1' , 'inputnode.itk_bold_to_t1' )]),
@@ -761,8 +796,8 @@ def init_func_preproc_wf(bold_file, has_fieldmap=False, existing_derivatives=Non
761
796
else :
762
797
# fmt:off
763
798
workflow .connect ([
764
- (split_opt_comb , bold_std_trans_wf , [
765
- ( 'out_files' , 'inputnode.bold_split' )])
799
+ (split_opt_comb , bold_std_trans_wf , [( 'out_files' , 'inputnode.bold_split' )]),
800
+ ( bold_std_trans_wf , outputnode , [( "outputnode.t2star_std" , "t2star_std" )]),
766
801
])
767
802
# fmt:on
768
803
0 commit comments