Skip to content

Commit

Permalink
fix: generate final bold reference after resampling
Browse files Browse the repository at this point in the history
  • Loading branch information
eilidhmacnicol committed May 9, 2023
1 parent d95a453 commit 42fe758
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions fprodents/workflows/bold/resampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ def init_bold_std_trans_wf(
from niworkflows.interfaces.nibabel import GenerateSamplingReference
from niworkflows.interfaces.nilearn import Merge
from niworkflows.utils.spaces import format_reference
from ...patch.workflows.func import init_bold_reference_wf

workflow = Workflow(name=name)
output_references = spaces.cached.get_spaces(nonstandard=False, dim=(3,))
Expand Down Expand Up @@ -224,7 +225,7 @@ def init_bold_std_trans_wf(
)

merge = pe.Node(Merge(compress=use_compression), name="merge", mem_gb=mem_gb * 3)

gen_final_ref = init_bold_reference_wf(omp_nthreads=omp_nthreads, pre_mask=True)
# fmt:off
workflow.connect([
(iterablesource, split_target, [('std_target', 'in_target')]),
Expand All @@ -248,9 +249,11 @@ def init_bold_std_trans_wf(
(gen_ref, bold_to_std_transform, [('out_file', 'reference_image')]),
(gen_ref, mask_std_tfm, [('out_file', 'reference_image')]),
(mask_merge_tfms, mask_std_tfm, [('out', 'transforms')]),
(mask_std_tfm, gen_final_ref, [("output_image", "inputnode.bold_mask")]),
(gen_ref, ref_std_tfm, [('out_file', 'reference_image')]),
(mask_merge_tfms, ref_std_tfm, [('out', 'transforms')]),
(bold_to_std_transform, merge, [('out_files', 'in_files')]),
(merge, gen_final_ref, [("out_file", "inputnode.bold_file")]),
])
# fmt:on

Expand All @@ -271,7 +274,7 @@ def init_bold_std_trans_wf(
(iterablesource, poutputnode, [
(('std_target', format_reference), 'spatial_reference')]),
(merge, poutputnode, [('out_file', 'bold_std')]),
(ref_std_tfm, poutputnode, [('output_image', 'bold_std_ref')]),
(gen_final_ref, poutputnode, [('outputnode.ref_image', 'bold_std_ref')]),
(mask_std_tfm, poutputnode, [('output_image', 'bold_mask_std')]),
(select_std, poutputnode, [('key', 'template')]),
])
Expand Down

0 comments on commit 42fe758

Please sign in to comment.