Skip to content

Commit 5407f0a

Browse files
committed
moved origins to zero prior to any reslicing (this avoids a problem present in some images where the volume gets truncated upon reslicing)
1 parent 62e3456 commit 5407f0a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

nipype/workflows/dmri/dtitk/tensor_registration.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ def diffeomorphic_tensor_pipeline(name='DiffeoTen',
7575
fields=['out_file', 'out_file_xfm',
7676
'fixed_resliced', 'moving_resliced']),
7777
name='outputnode')
78-
78+
origin_node_fixed = pe.Node(dtitk.TVAdjustVoxSp(origin=(0, 0, 0)),
79+
name='origin_node_fixed')
80+
origin_node_moving = origin_node_fixed.clone(name='origin_node_moving')
7981
reslice_node_pow2 = pe.Node(dtitk.TVResample(
8082
origin=(0, 0, 0),
8183
array_size=params['array_size']),
@@ -96,10 +98,12 @@ def diffeomorphic_tensor_pipeline(name='DiffeoTen',
9698
wf = pe.Workflow(name=name)
9799

98100
# Reslice input images
99-
wf.connect(inputnode, 'fixed_file', reslice_node_pow2, 'in_file')
101+
wf.connect(inputnode, 'fixed_file', origin_node_fixed, 'in_file')
102+
wf.connect(origin_node_fixed, 'out_file', reslice_node_pow2, 'in_file')
100103
wf.connect(reslice_node_pow2, 'out_file',
101104
reslice_node_moving, 'target_file')
102-
wf.connect(inputnode, 'moving_file', reslice_node_moving, 'in_file')
105+
wf.connect(inputnode, 'moving_file', origin_node_moving, 'in_file')
106+
wf.connect(origin_node_moving, 'out_file', reslice_node_moving, 'in_file')
103107
# Rigid registration
104108
wf.connect(reslice_node_pow2, 'out_file', rigid_node, 'fixed_file')
105109
wf.connect(reslice_node_moving, 'out_file', rigid_node, 'moving_file')

0 commit comments

Comments
 (0)