Skip to content

Commit

Permalink
fix: revise @effigies' b67636b & e43a8fd
Browse files Browse the repository at this point in the history
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...
  • Loading branch information
oesteban committed Oct 22, 2021
1 parent e43a8fd commit a7785d6
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions fmriprep/workflows/bold/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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")]),
Expand Down Expand Up @@ -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"),
Expand Down Expand Up @@ -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"),
Expand All @@ -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"),
Expand Down

0 comments on commit a7785d6

Please sign in to comment.