Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP, FIX] remove bold_mask generation from t2s #1800

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions fmriprep/workflows/bold/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,8 @@ def init_func_preproc_wf(bold_file):
('outputnode.ref_image_brain', 'inputnode.epi_brain'),
('outputnode.bold_mask', 'inputnode.epi_mask')]),
(bold_sdc_wf, bold_t1_trans_wf, [
('outputnode.out_warp', 'inputnode.fieldwarp')]),
('outputnode.out_warp', 'inputnode.fieldwarp'),
('outputnode.bold_mask', 'inputnode.ref_bold_mask')]),
(bold_sdc_wf, bold_bold_trans_wf, [
('outputnode.out_warp', 'inputnode.fieldwarp'),
('outputnode.epi_mask', 'inputnode.bold_mask')]),
Expand Down Expand Up @@ -518,8 +519,7 @@ def init_func_preproc_wf(bold_file):
(inputnode, func_derivatives_wf, [
('bold_file', 'inputnode.source_file')]),
(bold_bold_trans_wf, bold_confounds_wf, [
('outputnode.bold', 'inputnode.bold'),
('outputnode.bold_mask', 'inputnode.bold_mask')]),
('outputnode.bold', 'inputnode.bold')]),
(bold_split, bold_t1_trans_wf, [
('out_files', 'inputnode.bold_split')]),
])
Expand All @@ -531,8 +531,7 @@ def init_func_preproc_wf(bold_file):
(bold_bold_trans_wf, skullstrip_bold_wf, [
('outputnode.bold', 'inputnode.in_file')]),
(bold_t2s_wf, bold_confounds_wf, [
('outputnode.bold', 'inputnode.bold'),
('outputnode.bold_mask', 'inputnode.bold_mask')]),
('outputnode.bold', 'inputnode.bold')]),
(bold_t2s_wf, bold_t1_trans_wf, [
('outputnode.bold', 'inputnode.bold_split')]),
])
Expand Down Expand Up @@ -607,7 +606,7 @@ def init_func_preproc_wf(bold_file):
('outputnode.itk_bold_to_t1', 'transforms')]),
(bold_t1_trans_wf, boldmask_to_t1w, [
('outputnode.bold_mask_t1', 'reference_image')]),
(bold_bold_trans_wf if not multiecho else bold_t2s_wf, boldmask_to_t1w, [
(bold_bold_trans_wf, boldmask_to_t1w, [
('outputnode.bold_mask', 'input_image')]),
(boldmask_to_t1w, outputnode, [
('output_image', 'bold_mask_t1')]),
Expand Down Expand Up @@ -645,7 +644,7 @@ def init_func_preproc_wf(bold_file):
('outputnode.xforms', 'inputnode.hmc_xforms')]),
(bold_reg_wf, bold_std_trans_wf, [
('outputnode.itk_bold_to_t1', 'inputnode.itk_bold_to_t1')]),
(bold_bold_trans_wf if not multiecho else bold_t2s_wf, bold_std_trans_wf, [
(bold_bold_trans_wf, bold_std_trans_wf, [
('outputnode.bold_mask', 'inputnode.bold_mask')]),
(bold_sdc_wf, bold_std_trans_wf, [
('outputnode.out_warp', 'inputnode.fieldwarp')]),
Expand Down
12 changes: 4 additions & 8 deletions fmriprep/workflows/bold/t2s.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ def init_bold_t2s_wf(echo_times, mem_gb, omp_nthreads,

"""
from niworkflows.engine.workflows import LiterateWorkflow as Workflow
from niworkflows.func.util import init_skullstrip_bold_wf

workflow = Workflow(name=name)
workflow.__desc__ = """\
Expand All @@ -79,21 +78,18 @@ def init_bold_t2s_wf(echo_times, mem_gb, omp_nthreads,

inputnode = pe.Node(niu.IdentityInterface(fields=['bold_file']), name='inputnode')

outputnode = pe.Node(niu.IdentityInterface(fields=['bold', 'bold_mask', 'bold_ref_brain']),
outputnode = pe.Node(niu.IdentityInterface(fields=['bold', 'bold_ref_brain']),
name='outputnode')

LOGGER.log(25, 'Generating T2* map and optimally combined ME-EPI time series.')

t2smap_node = pe.Node(T2SMap(echo_times=echo_times), name='t2smap_node')
skullstrip_t2smap_wf = init_skullstrip_bold_wf(name='skullstrip_t2smap_wf')

workflow.connect([
(inputnode, t2smap_node, [('bold_file', 'in_files')]),
(t2smap_node, outputnode, [('optimal_comb', 'bold')]),
(t2smap_node, skullstrip_t2smap_wf, [('t2star_map', 'inputnode.in_file')]),
(skullstrip_t2smap_wf, outputnode, [
('outputnode.mask_file', 'bold_mask'),
('outputnode.skull_stripped_file', 'bold_ref_brain')]),
(t2smap_node, outputnode, [
('optimal_comb', 'bold'),
('t2star_map', 'bold_ref_brain')]),
])

return workflow