2222from nipype .interfaces .afni import utils as afni_utils
2323from CPAC .anat_preproc .lesion_preproc import create_lesion_preproc
2424from CPAC .func_preproc .utils import chunk_ts , split_ts_chunks
25- from CPAC .qc .globals import registration_guardrails
2625from CPAC .registration .utils import seperate_warps_list , \
2726 check_transforms , \
2827 generate_inverse_transform_flags , \
@@ -922,7 +921,6 @@ def create_bbregister_func_to_anat(phase_diff_distcor, name, bbreg_status,
922921 Functional data in anatomical space
923922 """
924923 suffix = f'{ bbreg_status .title ()} _{ pipe_num } '
925- retry = bbreg_status == 'On'
926924 register_bbregister_func_to_anat = pe .Workflow (name = f'{ name } _{ suffix } ' )
927925 inputspec = pe .Node (util .IdentityInterface (fields = ['func' ,
928926 'anat' ,
@@ -961,7 +959,8 @@ def bbreg_args(bbreg_target):
961959 name = f'bbreg_func_to_anat_{ suffix } ' )
962960 bbreg_func_to_anat .inputs .dof = 6
963961 bbreg_func_to_anat = register_bbregister_func_to_anat .guardrailed_node (
964- bbreg_func_to_anat , 'reference' , 'out_file' , pipe_num )
962+ bbreg_func_to_anat , 'reference' , 'out_file' , pipe_num ,
963+ retry = bbreg_status == 'On' )
965964 register_bbregister_func_to_anat .connect ([
966965 (inputspec , bbreg_func_to_anat , [
967966 ('bbr_schedule' , 'schedule' ),
@@ -979,21 +978,14 @@ def bbreg_args(bbreg_target):
979978 ('fieldmapmask' , 'fieldmapmask' )]),
980979 (inputNode_echospacing , bbreg_func_to_anat , [
981980 ('echospacing' , 'echospacing' )])])
982- if retry and registration_guardrails .retry_on_first_failure :
983- outfile = register_bbregister_func_to_anat .guardrail_selection (
984- bbreg_func_to_anat , 'out_file' )
985- matrix = register_bbregister_func_to_anat .guardrail_selection (
986- bbreg_func_to_anat , 'out_matrix_file' )
987- register_bbregister_func_to_anat .connect (
988- matrix , 'out' , outputspec , 'func_to_anat_linear_xfm' )
989- register_bbregister_func_to_anat .connect (outfile , 'out' ,
990- outputspec , 'anat_func' )
991- else :
992- register_bbregister_func_to_anat .connect (
993- bbreg_func_to_anat , 'out_matrix_file' ,
994- outputspec , 'func_to_anat_linear_xfm' )
995- register_bbregister_func_to_anat .connect (
996- bbreg_func_to_anat , 'out_file' , outputspec , 'anat_func' )
981+ outfile = register_bbregister_func_to_anat .guardrail_selection (
982+ bbreg_func_to_anat , 'out_file' )
983+ matrix = register_bbregister_func_to_anat .guardrail_selection (
984+ bbreg_func_to_anat , 'out_matrix_file' )
985+ register_bbregister_func_to_anat .connect (
986+ matrix , 'out' , outputspec , 'func_to_anat_linear_xfm' )
987+ register_bbregister_func_to_anat .connect (outfile , 'out' ,
988+ outputspec , 'anat_func' )
997989 return register_bbregister_func_to_anat
998990
999991
@@ -1827,7 +1819,7 @@ def bold_to_T1template_xfm_connector(wf_name, cfg, reg_tool, symmetric=False,
18271819 name = 'change_transform_type' )
18281820
18291821 wf .connect (fsl_reg_2_itk , 'itk_transform' ,
1830- change_transform , 'input_affine_file' )
1822+ change_transform , 'input_affine_file' )
18311823
18321824 # combine ALL xfm's into one - makes it easier downstream
18331825 write_composite_xfm = pe .Node (
@@ -2862,10 +2854,6 @@ def coregistration(wf, cfg, strat_pool, pipe_num, opt=None):
28622854 cfg .registration_workflows ['functional_registration' ][
28632855 'coregistration' ]['boundary_based_registration' ][
28642856 'bbr_wm_mask_args' ]
2865- if fallback :
2866- bbreg_guardrail = pe .registration_guardrail_node (
2867- f'bbreg{ bbreg_status } _guardrail_{ pipe_num } ' ,
2868- raise_on_failure = False )
28692857
28702858 node , out = strat_pool .get_data ('sbref' )
28712859 wf .connect (node , out , func_to_anat_bbreg , 'inputspec.func' )
@@ -2875,16 +2863,12 @@ def coregistration(wf, cfg, strat_pool, pipe_num, opt=None):
28752863 'reference' ] == 'whole-head' :
28762864 node , out = strat_pool .get_data ('desc-head_T1w' )
28772865 wf .connect (node , out , func_to_anat_bbreg , 'inputspec.anat' )
2878- if fallback :
2879- wf .connect (node , out , bbreg_guardrail , 'reference' )
28802866
28812867 elif cfg .registration_workflows ['functional_registration' ][
28822868 'coregistration' ]['boundary_based_registration' ][
28832869 'reference' ] == 'brain' :
28842870 node , out = strat_pool .get_data ('desc-preproc_T1w' )
28852871 wf .connect (node , out , func_to_anat_bbreg , 'inputspec.anat' )
2886- if fallback :
2887- wf .connect (node , out , bbreg_guardrail , 'reference' )
28882872
28892873 wf .connect (func_to_anat , 'outputspec.func_to_anat_linear_xfm_nobbreg' ,
28902874 func_to_anat_bbreg , 'inputspec.linear_reg_matrix' )
0 commit comments