Skip to content

Commit

Permalink
enh: define a flip_info output for fsl_bbr_wf because otherwise test …
Browse files Browse the repository at this point in the history
…of the workflow initialisation fails complaining this connection does not exist. The output is the dictionary with the same keys as the flip_info for the bbr_wf except the value associated with the keys are empty.
  • Loading branch information
celprov committed Jun 20, 2024
1 parent a49a128 commit 7a976df
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion fmriprep/workflows/bold/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ def init_fsl_bbr_wf(
name='inputnode',
)
outputnode = pe.Node(
niu.IdentityInterface(['itk_bold_to_t1', 'itk_t1_to_bold', 'fallback']),
niu.IdentityInterface(['itk_bold_to_t1', 'itk_t1_to_bold', 'fallback', 'flip_info']),
name='outputnode',
)

Expand Down Expand Up @@ -605,6 +605,11 @@ def init_fsl_bbr_wf(
name='fsl2itk_inv',
mem_gb=DEFAULT_MEMORY_MIN_GB,
)

def flip_detection_not_implemented_yet():
return {'warning': 'Flip detection not implemented yet for alignment with FSL flirt', 'cost_original': '', 'cost_flipped': ''}

Check warning on line 610 in fmriprep/workflows/bold/registration.py

View check run for this annotation

Codecov / codecov/patch

fmriprep/workflows/bold/registration.py#L610

Added line #L610 was not covered by tests

check_flip = pe.Node(niu.Function(function=flip_detection_not_implemented_yet, output_names=['flip_info']), name='check_flip')
# fmt:off
workflow.connect([
(inputnode, mask_t1w_brain, [('t1w_preproc', 'in_file'),
Expand All @@ -619,6 +624,7 @@ def init_fsl_bbr_wf(
(invt_bbr, fsl2itk_inv, [('out_file', 'transform_file')]),
(fsl2itk_fwd, outputnode, [('itk_transform', 'itk_bold_to_t1')]),
(fsl2itk_inv, outputnode, [('itk_transform', 'itk_t1_to_bold')]),
(check_flip, outputnode, [('flip_info', 'flip_info')]),
])
# fmt:on

Expand Down

0 comments on commit 7a976df

Please sign in to comment.