From a7785d6c055bdecd0f093529b110b7d6e87ccc67 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Fri, 22 Oct 2021 09:29:40 +0200 Subject: [PATCH] fix: revise @effigies' b67636b & e43a8fd Turns out that our bold-to-bold resampling workflow has fake inputs and outputs called ``bold_mask``. That made me believe that, if we were joining the bold echoes from the bold-to-bold resampling workflow, we could do the same with the mask. Looking into this in depth made me realize of the confusing i/o spec of the workflow, and also of the fact that it is unnecessary to join anything in the absence of fieldwarp because the mask is the same you calculated with the initial boldref. So I connected that one and locally seems to be functioning okay. Hopefully, this was the last bit of this not-so-trivial attempt to organize the ME-EPI pathway. I'm already shaking by thinking at some point we will need a similar in-depth revision of the SBRef dealings... --- fmriprep/workflows/bold/base.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/fmriprep/workflows/bold/base.py b/fmriprep/workflows/bold/base.py index c39f6333d..72a08db22 100644 --- a/fmriprep/workflows/bold/base.py +++ b/fmriprep/workflows/bold/base.py @@ -507,7 +507,7 @@ def init_func_preproc_wf(bold_file, has_fieldmap=False): inputnode.inputs.bold_file = ref_file # Replace reference w first echo join_echos = pe.JoinNode( - niu.IdentityInterface(fields=["bold_files", "bold_masks"]), + niu.IdentityInterface(fields=["bold_files"]), joinsource=("meepi_echos" if run_stc is True else "boldbuffer"), joinfield=["bold_files"], name="join_echos", @@ -640,7 +640,6 @@ def init_func_preproc_wf(bold_file, has_fieldmap=False): ]), (join_echos, bold_t2s_wf, [ ("bold_files", "inputnode.bold_file"), - (("bold_masks", pop_file), "inputnode.bold_mask"), ]), (bold_t2s_wf, split_opt_comb, [("outputnode.bold", "in_file")]), (split_opt_comb, bold_t1_trans_wf, [("out_files", "inputnode.bold_split")]), @@ -997,9 +996,11 @@ def init_func_preproc_wf(bold_file, has_fieldmap=False): ("outputnode.bold", "inputnode.bold_file"), ]), ] if not multiecho else [ + (initial_boldref_wf, bold_t2s_wf, [ + ("outputnode.bold_mask", "inputnode.bold_mask"), + ]), (bold_bold_trans_wf, join_echos, [ ("outputnode.bold", "bold_files"), - ("outputnode.bold_mask", "bold_masks"), ]), (join_echos, final_boldref_wf, [ ("bold_files", "inputnode.bold_file"), @@ -1136,7 +1137,6 @@ def _dpop(list_of_lists): workflow.connect([ (unwarp_wf, join_echos, [ ("outputnode.corrected", "bold_files"), - ("outputnode.corrected_mask", "bold_masks"), ]), (unwarp_wf, join_sdc_echos, [ ("outputnode.fieldmap", "fieldmap"), @@ -1149,6 +1149,9 @@ def _dpop(list_of_lists): (join_sdc_echos, final_boldref_wf, [ ("corrected", "inputnode.bold_file"), ]), + (join_sdc_echos, bold_t2s_wf, [ + ("corrected_mask", "inputnode.bold_mask"), + ]), (join_sdc_echos, bold_t1_trans_wf, [ # TEMPORARY: For the moment we can't use frame-wise fieldmaps (("fieldwarp", _dpop), "inputnode.fieldwarp"),