Skip to content

Commit

Permalink
Merge pull request #201 from chrisfilo/fix/itk_transforms
Browse files Browse the repository at this point in the history
[RTM] Fix a bug causing epi to T1 transformations not to be applied.
  • Loading branch information
Shoshana Berleant committed Dec 4, 2016
2 parents cc52405 + 4fe9933 commit 5bc7bb6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion fmriprep/workflows/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def wf_ds005_type(subject_data, settings, name='fMRI_prep'):
(epi_2_t1, confounds_wf, [('outputnode.mat_t1_to_epi', 'inputnode.t1_transform')]),

(hmcwf, epi_mni_trans_wf, [('inputnode.epi', 'inputnode.epi')]),
(epi_2_t1, epi_mni_trans_wf, [('outputnode.mat_epi_to_t1', 'inputnode.mat_epi_to_t1')]),
(epi_2_t1, epi_mni_trans_wf, [('outputnode.itk_epi_to_t1', 'inputnode.itk_epi_to_t1')]),
(hmcwf, epi_mni_trans_wf, [('outputnode.xforms', 'inputnode.hmc_xforms'),
('outputnode.epi_mask', 'inputnode.epi_mask')]),
(t1w_pre, epi_mni_trans_wf, [('outputnode.t1_brain', 'inputnode.t1'),
Expand Down
10 changes: 6 additions & 4 deletions fmriprep/workflows/epi.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ def epi_mean_t1_registration(name='EPIMeanNormalization', settings=None):
name='inputnode'
)
outputnode = pe.Node(
niu.IdentityInterface(fields=['mat_epi_to_t1', 'mat_t1_to_epi']),
niu.IdentityInterface(fields=['mat_epi_to_t1', 'mat_t1_to_epi',
'itk_epi_to_t1', 'itk_t1_to_epi']),
name='outputnode'
)

Expand Down Expand Up @@ -227,6 +228,7 @@ def epi_mean_t1_registration(name='EPIMeanNormalization', settings=None):
(wm_mask, flt_bbr, [('out_file', 'wm_seg')]),
(flt_bbr, invt_bbr, [('out_matrix_file', 'in_file')]),
(invt_bbr, outputnode, [('out_file', 'mat_t1_to_epi')]),
(flt_bbr, outputnode, [('out_matrix_file', 'mat_epi_to_t1')]),
(flt_bbr, fsl2itk_fwd, [('out_matrix_file', 'transform_file')]),
(invt_bbr, fsl2itk_inv, [('out_file', 'transform_file')]),
(fsl2itk_fwd, outputnode, [('itk_transform', 'itk_epi_to_t1')]),
Expand Down Expand Up @@ -357,7 +359,7 @@ def epi_mni_transformation(name='EPIMNITransformation', settings=None):
workflow = pe.Workflow(name=name)
inputnode = pe.Node(
niu.IdentityInterface(fields=[
'mat_epi_to_t1',
'itk_epi_to_t1',
't1_2_mni_forward_transform',
'epi',
'epi_mask',
Expand Down Expand Up @@ -413,10 +415,10 @@ def _aslist(in_value):
(inputnode, ds_mni_mask, [('epi', 'source_file')]),
(pick_1st, gen_ref, [('roi_file', 'moving_image')]),
(inputnode, merge_transforms, [('t1_2_mni_forward_transform', 'in1'),
(('mat_epi_to_t1', _aslist), 'in2'),
(('itk_epi_to_t1', _aslist), 'in2'),
('hmc_xforms', 'in3')]),
(inputnode, mask_merge_tfms, [('t1_2_mni_forward_transform', 'in1'),
(('mat_epi_to_t1', _aslist), 'in2')]),
(('itk_epi_to_t1', _aslist), 'in2')]),
(inputnode, split, [('epi', 'in_file')]),
(split, epi_to_mni_transform, [('out_files', 'input_image')]),
(merge_transforms, epi_to_mni_transform, [('out', 'transforms')]),
Expand Down

0 comments on commit 5bc7bb6

Please sign in to comment.