Skip to content

Commit ac3286d

Browse files
committed
reslice output image to match input fixed
1 parent 5407f0a commit ac3286d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

nipype/workflows/dmri/dtitk/tensor_registration.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ def diffeomorphic_tensor_pipeline(name='DiffeoTen',
5555
(Rigid and Affine follwed by Diffeomorphic)
5656
Note: the requirements for a diffeomorphic registration specify that
5757
the dimension 0 is a power of 2 so images are resliced prior to
58-
registration
58+
registration. Remember to move origin and reslice prior to applying xfm to
59+
another file
5960
6061
Example
6162
-------
@@ -94,6 +95,8 @@ def diffeomorphic_tensor_pipeline(name='DiffeoTen',
9495
compose_xfm_node = pe.Node(dtitk.ComposeXfm(), name='compose_xfm_node')
9596
apply_xfm_node = pe.Node(dtitk.DiffeoSymTensor3DVol(),
9697
name='apply_xfm_node')
98+
reslice_node_to_input = pe.Node(dtitk.TVResample(),
99+
name='reslice_node_to_input')
97100

98101
wf = pe.Workflow(name=name)
99102

@@ -122,8 +125,11 @@ def diffeomorphic_tensor_pipeline(name='DiffeoTen',
122125
# Apply transform
123126
wf.connect(reslice_node_moving, 'out_file', apply_xfm_node, 'in_file')
124127
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')
125131
# Send to output
126-
wf.connect(apply_xfm_node, 'out_file', outputnode, 'out_file')
132+
wf.connect(reslice_node_to_input, 'out_file', outputnode, 'out_file')
127133
wf.connect(compose_xfm_node, 'out_file', outputnode, 'out_file_xfm')
128134
wf.connect(reslice_node_pow2, 'out_file', outputnode, 'fixed_resliced')
129135
wf.connect(reslice_node_moving, 'out_file', outputnode, 'moving_resliced')

0 commit comments

Comments
 (0)