Skip to content

Commit

Permalink
Fix order of connections.
Browse files Browse the repository at this point in the history
  • Loading branch information
tsalo committed Nov 9, 2024
1 parent c59d589 commit c9f655d
Showing 1 changed file with 30 additions and 24 deletions.
54 changes: 30 additions & 24 deletions fmriprep/workflows/bold/fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -896,42 +896,48 @@ def init_bold_native_wf(
]) # fmt:skip

if config.workflow.thermal_denoise_method:
norf_source = pe.Node(niu.Select(inlist=norf_files), name='norf_source')
validate_norf = pe.Node(ValidateImage(), name='validate_norf')
workflow.connect([
(echo_index, norf_source, [('echoidx', 'index')]),
(norf_source, validate_norf, [('out', 'in_file')]),
]) # fmt:skip

phase_source = pe.Node(niu.Select(inlist=phase_files), name='phase_source')
validate_phase = pe.Node(ValidateImage(), name='validate_phase')
workflow.connect([
(echo_index, phase_source, [('echoidx', 'index')]),
(phase_source, validate_phase, [('out', 'in_file')]),
]) # fmt:skip

phase_norf_source = pe.Node(niu.Select(inlist=phase_norf_files), name='phase_norf_source')
validate_phase_norf = pe.Node(ValidateImage(), name='validate_phase_norf')
workflow.connect([
(echo_index, phase_norf_source, [('echoidx', 'index')]),
(phase_norf_source, validate_phase_norf, [('out', 'in_file')]),
]) # fmt:skip

dwidenoise_wf = init_bold_dwidenoise_wf(

Check warning on line 899 in fmriprep/workflows/bold/fit.py

View check run for this annotation

Codecov / codecov/patch

fmriprep/workflows/bold/fit.py#L899

Added line #L899 was not covered by tests
has_phase=has_phase,
has_norf=has_norf,
mem_gb=mem_gb,
)
workflow.connect([

Check warning on line 904 in fmriprep/workflows/bold/fit.py

View check run for this annotation

Codecov / codecov/patch

fmriprep/workflows/bold/fit.py#L904

Added line #L904 was not covered by tests
(validate_bold, dwidenoise_wf, [('out_file', 'inputnode.mag_file')]),
(validate_norf, dwidenoise_wf, [('out_file', 'inputnode.norf_file')]),
(validate_phase, dwidenoise_wf, [('out_file', 'inputnode.phase_file')]),
(validate_phase_norf, dwidenoise_wf, [('out_file', 'inputnode.phase_norf_file')]),
(dwidenoise_wf, denoisebuffer, [
('outputnode.mag_file', 'bold_file'),
('outputnode.phase_file', 'phase_file'),
]),
]) # fmt:skip

if has_norf:
norf_source = pe.Node(niu.Select(inlist=norf_files), name='norf_source')
validate_norf = pe.Node(ValidateImage(), name='validate_norf')
workflow.connect([

Check warning on line 915 in fmriprep/workflows/bold/fit.py

View check run for this annotation

Codecov / codecov/patch

fmriprep/workflows/bold/fit.py#L913-L915

Added lines #L913 - L915 were not covered by tests
(echo_index, norf_source, [('echoidx', 'index')]),
(norf_source, validate_norf, [('out', 'in_file')]),
(validate_norf, dwidenoise_wf, [('out_file', 'inputnode.norf_file')]),
]) # fmt:skip

if has_phase:
phase_source = pe.Node(niu.Select(inlist=phase_files), name='phase_source')
validate_phase = pe.Node(ValidateImage(), name='validate_phase')
workflow.connect([

Check warning on line 924 in fmriprep/workflows/bold/fit.py

View check run for this annotation

Codecov / codecov/patch

fmriprep/workflows/bold/fit.py#L922-L924

Added lines #L922 - L924 were not covered by tests
(echo_index, phase_source, [('echoidx', 'index')]),
(phase_source, validate_phase, [('out', 'in_file')]),
(validate_phase, dwidenoise_wf, [('out_file', 'inputnode.phase_file')]),
]) # fmt:skip

if has_phase and has_norf:
phase_norf_source = pe.Node(

Check warning on line 931 in fmriprep/workflows/bold/fit.py

View check run for this annotation

Codecov / codecov/patch

fmriprep/workflows/bold/fit.py#L931

Added line #L931 was not covered by tests
niu.Select(inlist=phase_norf_files),
name='phase_norf_source',
)
validate_phase_norf = pe.Node(ValidateImage(), name='validate_phase_norf')
workflow.connect([

Check warning on line 936 in fmriprep/workflows/bold/fit.py

View check run for this annotation

Codecov / codecov/patch

fmriprep/workflows/bold/fit.py#L935-L936

Added lines #L935 - L936 were not covered by tests
(echo_index, phase_norf_source, [('echoidx', 'index')]),
(phase_norf_source, validate_phase_norf, [('out', 'in_file')]),
(validate_phase_norf, dwidenoise_wf, [('out_file', 'inputnode.phase_norf_file')]),
]) # fmt:skip
else:
workflow.connect([(validate_bold, denoisebuffer, [('out_file', 'bold_file')])])

Expand Down

0 comments on commit c9f655d

Please sign in to comment.