Skip to content

Commit 66627d0

Browse files
committed
fix: Retrieve fieldmaps and HMC boldref from output directory
1 parent 568dc43 commit 66627d0

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

fmriprep/workflows/base.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,11 +726,20 @@ def init_single_subject_wf(
726726
if node.split('.')[-1].startswith('ds_'):
727727
fmap_wf.get_node(node).interface.out_path_base = ''
728728

729+
# Retrieve fieldmap files from the derivatives directory
730+
# TODO: SDCFlows should route these files through the outputnode
731+
output_map = {
732+
'fmap': 'fmap_derivatives_wf.ds_fieldmap.out_file',
733+
'fmap_ref': 'fmap_derivatives_wf.ds_reference.out_file',
734+
'fmap_coeff': 'fmap_derivatives_wf.ds_coeff.out_file',
735+
}
736+
729737
workflow.connect([
730738
(fmap_wf, fmap_buffers[field], [
731739
# We get "sdc_method" as "method" from estimator workflows
732740
# All else stays the same, and no other sdc_ prefixes are used
733-
(f'outputnode.{field.removeprefix("sdc_")}', 'in2'),
741+
(output_map[field.removeprefix('sdc_')], 'in2')
742+
# (f'outputnode.{field.removeprefix("sdc_")}', 'in2'),
734743
])
735744
for field in fmap_buffers
736745
]) # fmt:skip

fmriprep/workflows/bold/fit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,12 +408,12 @@ def init_bold_fit_wf(
408408
ds_hmc_boldref_wf.inputs.inputnode.source_files = [bold_file]
409409

410410
workflow.connect([
411+
(hmc_boldref_wf, ds_hmc_boldref_wf, [('outputnode.boldref', 'inputnode.boldref')]),
412+
(ds_hmc_boldref_wf, hmcref_buffer, [('outputnode.boldref', 'boldref')]),
411413
(hmc_boldref_wf, hmcref_buffer, [
412414
('outputnode.bold_file', 'bold_file'),
413-
('outputnode.boldref', 'boldref'),
414415
('outputnode.skip_vols', 'dummy_scans'),
415416
]),
416-
(hmcref_buffer, ds_hmc_boldref_wf, [('boldref', 'inputnode.boldref')]),
417417
(hmc_boldref_wf, summary, [('outputnode.algo_dummy_scans', 'algo_dummy_scans')]),
418418
(hmc_boldref_wf, func_fit_reports_wf, [
419419
('outputnode.validation_report', 'inputnode.validation_report'),

0 commit comments

Comments
 (0)