Skip to content

Commit fe139cc

Browse files
shnizzedysgiavasis
andcommitted
♻️ Give each guardrail a unique name
Co-authored-by: Steve Giavasis <[email protected]>
1 parent 58811df commit fe139cc

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

CPAC/registration/registration.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def apply_transform(wf_name, reg_tool, time_series=False, multi_input=False,
6767
multi_input = True
6868

6969
# Guardrail: check QC metrics
70-
guardrail = registration_guardrail_node()
70+
guardrail = registration_guardrail_node(f'{wf_name}_guardrail')
7171
wf.connect(inputNode, 'reference', guardrail, 'reference')
7272

7373
if reg_tool == 'ants':
@@ -331,7 +331,7 @@ def create_fsl_flirt_linear_reg(name='fsl_flirt_linear_reg'):
331331
linear_reg = pe.Node(interface=fsl.FLIRT(), name='linear_reg_0')
332332
linear_reg.inputs.cost = 'corratio'
333333

334-
guardrail = registration_guardrail_node()
334+
guardrail = registration_guardrail_node(f'{name}_guardrail')
335335

336336
inv_flirt_xfm = pe.Node(interface=fsl.utils.ConvertXFM(),
337337
name='inv_linear_reg0_xfm')
@@ -710,7 +710,7 @@ def create_register_func_to_anat(config, phase_diff_distcor=False,
710710
name='outputspec')
711711

712712
linear_reg = pe.Node(interface=fsl.FLIRT(), name='linear_func_to_anat')
713-
guardrail = registration_guardrail_node()
713+
guardrail = registration_guardrail_node(f'{name}_guardrail')
714714

715715
linear_reg.inputs.interp = config.registration_workflows[
716716
'functional_registration']['coregistration']['interpolation']
@@ -1023,7 +1023,7 @@ def bbreg_args(bbreg_target):
10231023
inputNode_echospacing, 'echospacing',
10241024
bbreg_func_to_anat, 'echospacing')
10251025

1026-
guardrail = registration_guardrail_node()
1026+
guardrail = registration_guardrail_node(name=f'{name}_guardrail')
10271027
register_bbregister_func_to_anat.connect(inputspec, 'anat',
10281028
guardrail, 'reference')
10291029
register_bbregister_func_to_anat.connect(
@@ -1255,7 +1255,7 @@ def create_wf_calculate_ants_warp(name='create_wf_calculate_ants_warp',
12551255

12561256
select_inverse_warp.inputs.selection = "Inverse"
12571257

1258-
guardrail = registration_guardrail_node()
1258+
guardrail = registration_guardrail_node(f'{name}_guardrail')
12591259
calc_ants_warp_wf.connect(inputspec, 'moving_brain',
12601260
calculate_ants_warp, 'moving_brain')
12611261
calc_ants_warp_wf.connect(inputspec, 'reference_brain',
@@ -3692,7 +3692,8 @@ def single_step_resample_timeseries_to_T1template(wf, cfg, strat_pool,
36923692
output_names=['itk_transform'],
36933693
function=run_c3d),
36943694
name=f'convert_bbr2itk_{pipe_num}')
3695-
guardrail_preproc = registration_guardrail_node()
3695+
guardrail_preproc = registration_guardrail_node(
3696+
'single-step-resampling-preproc_guardrail')
36963697
if cfg.registration_workflows['functional_registration'][
36973698
'coregistration']['boundary_based_registration'][
36983699
'reference'] == 'whole-head':
@@ -3768,7 +3769,8 @@ def single_step_resample_timeseries_to_T1template(wf, cfg, strat_pool,
37683769

37693770
applyxfm_func_to_standard.inputs.float = True
37703771
applyxfm_func_to_standard.inputs.interpolation = 'LanczosWindowedSinc'
3771-
guardrail_brain = registration_guardrail_node()
3772+
guardrail_brain = registration_guardrail_node(
3773+
'single-step-resampling-brain_guardrail')
37723774

37733775
wf.connect(split_func, 'out_files',
37743776
applyxfm_func_to_standard, 'input_image')

0 commit comments

Comments
 (0)