@@ -3149,7 +3149,7 @@ def correct_restore_brain_intensity_abcd(wf, cfg, strat_pool, pipe_num,
31493149     "switch": "None", 
31503150     "option_key": "using", 
31513151     "option_val": "FreeSurfer-ABCD", 
3152-      "inputs": [([ "desc-preproc_T1w", "desc-reorient_T1w", "T1w"] , 
3152+      "inputs": [("desc-preproc_T1w", 
31533153                 "desc-n4_T1w", 
31543154                 "desc-restore-brain_T1w", 
31553155                 "space-T1w_desc-brain_mask", 
@@ -3175,43 +3175,43 @@ def correct_restore_brain_intensity_abcd(wf, cfg, strat_pool, pipe_num,
31753175
31763176    merge_t1_acpc .inputs .dimension  =  't' 
31773177
3178-     wf .connect (merge_t1_acpc_to_list , 'out' ,
3179-         merge_t1_acpc , 'in_files' )
3178+     wf .connect (merge_t1_acpc_to_list , 'out' , merge_t1_acpc , 'in_files' )
31803179
31813180    # fslmaths ${T1wFolder}/xfms/${T1wImage}_dc -mul 0 ${T1wFolder}/xfms/${T1wImage}_dc 
3182-     multiply_t1_acpc_by_zero  =  pe .Node (interface = fsl . ImageMaths (), 
3183-                                         name = f'multiply_t1_acpc_by_zero_ { pipe_num } ' ) 
3184-     
3181+     multiply_t1_acpc_by_zero  =  pe .Node (
3182+         interface = fsl . ImageMaths (), 
3183+          name = f'multiply_t1_acpc_by_zero_ { pipe_num } ' ) 
31853184    multiply_t1_acpc_by_zero .inputs .op_string  =  '-mul 0' 
31863185
3187-     wf .connect (merge_t1_acpc , 'merged_file' ,  
3188-         multiply_t1_acpc_by_zero , 'in_file' )
3186+     wf .connect (merge_t1_acpc , 'merged_file' ,
3187+                 multiply_t1_acpc_by_zero , 'in_file' )
31893188
31903189    # Ref: https://github.com/DCAN-Labs/DCAN-HCP/blob/master/PostFreeSurfer/PostFreeSurferPipeline.sh#L157 
31913190    # convertwarp --relout --rel --ref="$T1wFolder"/"$T1wImageBrainMask" --premat="$T1wFolder"/xfms/"$InitialT1wTransform" \ 
31923191    # --warp1="$T1wFolder"/xfms/"$dcT1wTransform" --out="$T1wFolder"/xfms/"$OutputOrigT1wToT1w" 
3193-     convertwarp_orig_t1_to_t1  =  pe .Node (interface = fsl .ConvertWarp (), 
3194-                                         name = f'convertwarp_orig_t1_to_t1_{ pipe_num }  ' )
3192+     convertwarp_orig_t1_to_t1  =  pe .Node (
3193+         interface = fsl .ConvertWarp (),
3194+         name = f'convertwarp_orig_t1_to_t1_{ pipe_num }  ' )
31953195
31963196    convertwarp_orig_t1_to_t1 .inputs .out_relwarp  =  True 
31973197    convertwarp_orig_t1_to_t1 .inputs .relwarp  =  True 
31983198
31993199    node , out  =  strat_pool .get_data ('space-T1w_desc-brain_mask' )
32003200    wf .connect (node , out , convertwarp_orig_t1_to_t1 , 'reference' )
32013201
3202-     node , out  =  strat_pool .get_data ('from-T1w_to-ACPC_mode-image_desc-aff2rig_xfm' )
3202+     node , out  =  strat_pool .get_data (
3203+         'from-T1w_to-ACPC_mode-image_desc-aff2rig_xfm' )
32033204    wf .connect (node , out , convertwarp_orig_t1_to_t1 , 'premat' )
32043205    wf .connect (multiply_t1_acpc_by_zero , 'out_file' ,
3205-         convertwarp_orig_t1_to_t1 , 'warp1' )
3206+                 convertwarp_orig_t1_to_t1 , 'warp1' )
32063207
32073208    # Ref: https://github.com/DCAN-Labs/DCAN-HCP/blob/master/PostFreeSurfer/scripts/CreateMyelinMaps.sh#L72-L73 
32083209    # applywarp --rel --interp=spline -i "$BiasField" -r "$T1wImageBrain" -w "$AtlasTransform" -o "$BiasFieldOutput" 
32093210    applywarp_biasfield  =  pe .Node (interface = fsl .ApplyWarp (),
32103211                                  name = f'applywarp_biasfield_{ pipe_num }  ' )
3212+ 
32113213    applywarp_biasfield .inputs .relwarp  =  True 
32123214    applywarp_biasfield .inputs .interp  =  'spline' 
3213-     guardrail_applywarp_biasfield  =  registration_guardrail_workflow (
3214-         applywarp_biasfield )
32153215
32163216    node , out  =  strat_pool .get_data ('desc-fast_biasfield' )
32173217    wf .connect (node , out , applywarp_biasfield , 'in_file' )
@@ -3227,33 +3227,30 @@ def correct_restore_brain_intensity_abcd(wf, cfg, strat_pool, pipe_num,
32273227                                  name = f'threshold_biasfield_{ pipe_num }  ' )
32283228
32293229    threshold_biasfield .inputs .op_string  =  '-thr 0.1' 
3230-     wf .connect (guardrail_applywarp_biasfield , 'outputspec.out_file' ,
3231-                threshold_biasfield , 'in_file' )
3230+     wf .connect (applywarp_biasfield , 'out_file' , threshold_biasfield , 'in_file' )
32323231
32333232    # Ref: https://github.com/DCAN-Labs/DCAN-HCP/blob/master/PostFreeSurfer/scripts/CreateMyelinMaps.sh#L67-L70 
32343233    # applywarp --rel --interp=spline -i "$OrginalT1wImage" -r "$T1wImageBrain" -w "$OutputOrigT1wToT1w" -o "$OutputT1wImage" 
32353234    applywarp_t1  =  pe .Node (interface = fsl .ApplyWarp (),
32363235                           name = f'applywarp_t1_{ pipe_num }  ' )
3236+ 
32373237    applywarp_t1 .inputs .relwarp  =  True 
32383238    applywarp_t1 .inputs .interp  =  'spline' 
3239-     guardrail_applywarp_t1  =  registration_guardrail_workflow (applywarp_t1 )
32403239
32413240    node , out  =  strat_pool .get_data ('desc-n4_T1w' )
32423241    wf .connect (node , out , applywarp_t1 , 'in_file' )
3243-      
3242+ 
32443243    node , out  =  strat_pool .get_data ('space-T1w_desc-brain_mask' )
32453244    wf .connect (node , out , applywarp_t1 , 'ref_file' )
32463245
32473246    wf .connect (convertwarp_orig_t1_to_t1 , 'out_file' ,
32483247               applywarp_t1 , 'field_file' )
32493248
32503249    # fslmaths "$OutputT1wImage" -abs "$OutputT1wImage" -odt float 
3251-     abs_t1  =  pe .Node (interface = fsl .ImageMaths (),
3252-                      name = f'abs_t1_{ pipe_num }  ' )
3250+     abs_t1  =  pe .Node (interface = fsl .ImageMaths (), name = f'abs_t1_{ pipe_num }  ' )
32533251
32543252    abs_t1 .inputs .op_string  =  '-abs' 
3255-     wf .connect (guardrail_applywarp_t1 , 'outputspec.out_file' ,
3256-                abs_t1 , 'in_file' )
3253+     wf .connect (applywarp_t1 , 'out_file' , abs_t1 , 'in_file' )
32573254
32583255    # fslmaths "$OutputT1wImage" -div "$BiasField" "$OutputT1wImageRestore" 
32593256    div_t1_by_biasfield  =  pe .Node (interface = fsl .ImageMaths (),
@@ -3270,14 +3267,11 @@ def correct_restore_brain_intensity_abcd(wf, cfg, strat_pool, pipe_num,
32703267    apply_mask  =  pe .Node (interface = fsl .maths .ApplyMask (),
32713268                         name = f'get_restored_corrected_brain_{ pipe_num }  ' )
32723269
3273-     wf .connect (div_t1_by_biasfield , 'out_file' ,
3274-         apply_mask , 'in_file' )
3270+     wf .connect (div_t1_by_biasfield , 'out_file' , apply_mask , 'in_file' )
32753271
32763272    node , out  =  strat_pool .get_data ('space-T1w_desc-brain_mask' )
32773273    wf .connect (node , out , apply_mask , 'mask_file' )
32783274
3279-     outputs  =  {
3280-         'desc-restore-brain_T1w' : (apply_mask , 'out_file' )
3281-     }
3275+     outputs  =  {'desc-restore-brain_T1w' : (apply_mask , 'out_file' )}
32823276
3283-     return  ( wf , outputs ) 
3277+     return  wf , outputs 
0 commit comments