Skip to content

Commit f8e8857

Browse files
fix: generate final bold reference after resampling
1 parent 83156d0 commit f8e8857

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

fprodents/workflows/bold/resampling.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ def init_bold_std_trans_wf(
115115
from niworkflows.interfaces.nibabel import GenerateSamplingReference
116116
from niworkflows.interfaces.nilearn import Merge
117117
from niworkflows.utils.spaces import format_reference
118+
from ...patch.workflows.func import init_bold_reference_wf
118119

119120
workflow = Workflow(name=name)
120121
output_references = spaces.cached.get_spaces(nonstandard=False, dim=(3,))
@@ -224,7 +225,7 @@ def init_bold_std_trans_wf(
224225
)
225226

226227
merge = pe.Node(Merge(compress=use_compression), name="merge", mem_gb=mem_gb * 3)
227-
228+
gen_final_ref = init_bold_reference_wf(omp_nthreads=omp_nthreads, pre_mask=True)
228229
# fmt:off
229230
workflow.connect([
230231
(iterablesource, split_target, [('std_target', 'in_target')]),
@@ -248,9 +249,11 @@ def init_bold_std_trans_wf(
248249
(gen_ref, bold_to_std_transform, [('out_file', 'reference_image')]),
249250
(gen_ref, mask_std_tfm, [('out_file', 'reference_image')]),
250251
(mask_merge_tfms, mask_std_tfm, [('out', 'transforms')]),
252+
(mask_std_tfm, gen_final_ref, [("output_image", "inputnode.bold_mask")]),
251253
(gen_ref, ref_std_tfm, [('out_file', 'reference_image')]),
252254
(mask_merge_tfms, ref_std_tfm, [('out', 'transforms')]),
253255
(bold_to_std_transform, merge, [('out_files', 'in_files')]),
256+
(merge, gen_final_ref, [("out_file", "inputnode.bold_file")]),
254257
])
255258
# fmt:on
256259

@@ -271,7 +274,7 @@ def init_bold_std_trans_wf(
271274
(iterablesource, poutputnode, [
272275
(('std_target', format_reference), 'spatial_reference')]),
273276
(merge, poutputnode, [('out_file', 'bold_std')]),
274-
(ref_std_tfm, poutputnode, [('output_image', 'bold_std_ref')]),
277+
(gen_final_ref, poutputnode, [('outputnode.ref_image', 'bold_std_ref')]),
275278
(mask_std_tfm, poutputnode, [('output_image', 'bold_mask_std')]),
276279
(select_std, poutputnode, [('key', 'template')]),
277280
])

0 commit comments

Comments
 (0)