Skip to content

Commit 73abfda

Browse files
committed
nonlinear wf works with nonzero origin images
1 parent 5d238c0 commit 73abfda

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

nipype/workflows/dmri/dtitk/tensor_registration.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,16 @@ def diffeomorphic_tensor_pipeline(name='DiffeoTen',
9595
compose_xfm_node = pe.Node(dtitk.ComposeXfm(), name='compose_xfm_node')
9696
apply_xfm_node = pe.Node(dtitk.DiffeoSymTensor3DVol(),
9797
name='apply_xfm_node')
98+
adjust_vs_node_to_input = pe.Node(dtitk.TVAdjustVoxSp(),
99+
name='adjust_vs_node_to_input')
98100
reslice_node_to_input = pe.Node(dtitk.TVResample(),
99101
name='reslice_node_to_input')
102+
input_fa = pe.Node(dtitk.TVtool(in_flag='fa'), name='input_fa')
100103

101104
wf = pe.Workflow(name=name)
102105

106+
# calculate input FA image for origin reference
107+
wf.connect(inputnode, 'fixed_file', input_fa, 'in_file')
103108
# Reslice input images
104109
wf.connect(inputnode, 'fixed_file', origin_node_fixed, 'in_file')
105110
wf.connect(origin_node_fixed, 'out_file', reslice_node_pow2, 'in_file')
@@ -125,9 +130,11 @@ def diffeomorphic_tensor_pipeline(name='DiffeoTen',
125130
# Apply transform
126131
wf.connect(reslice_node_moving, 'out_file', apply_xfm_node, 'in_file')
127132
wf.connect(compose_xfm_node, 'out_file', apply_xfm_node, 'transform')
128-
# Reslice to match original fixed input image
129-
wf.connect(apply_xfm_node, 'out_file', reslice_node_to_input, 'in_file')
130-
wf.connect(inputnode, 'fixed_file', reslice_node_to_input, 'target_file')
133+
# Move origin and reslice to match original fixed input image
134+
wf.connect(apply_xfm_node, 'out_file', adjust_vs_node_to_input, 'in_file')
135+
wf.connect(input_fa, 'out_file', adjust_vs_node_to_input, 'target_file')
136+
wf.connect(adjust_vs_node_to_input, 'out_file', reslice_node_to_input, 'in_file')
137+
wf.connect(input_fa, 'out_file', reslice_node_to_input, 'target_file')
131138
# Send to output
132139
wf.connect(reslice_node_to_input, 'out_file', outputnode, 'out_file')
133140
wf.connect(compose_xfm_node, 'out_file', outputnode, 'out_file_xfm')

0 commit comments

Comments
 (0)