@@ -66,8 +66,8 @@ class ComputeMeshWarp(BaseInterface):
66
66
Example
67
67
-------
68
68
69
- >>> import nipype.algorithms.mesh as mesh
70
- >>> dist = mesh .ComputeMeshWarp()
69
+ >>> import nipype.algorithms.mesh as m
70
+ >>> dist = m .ComputeMeshWarp()
71
71
>>> dist.inputs.surface1 = 'surf1.vtk'
72
72
>>> dist.inputs.surface2 = 'surf2.vtk'
73
73
>>> res = dist.run() # doctest: +SKIP
@@ -140,16 +140,21 @@ def _run_interface(self, runtime):
140
140
out_mesh = tvtk .PolyData ()
141
141
out_mesh .points = vtk1 .points
142
142
out_mesh .polys = vtk1 .polys
143
- out_mesh .point_data .warpings = [tuple (d ) for d in diff ]
144
-
145
- write_data (out_mesh , op .abspath (self .inputs .out_warp ))
143
+ out_mesh .point_data .vectors = diff
144
+ out_mesh .point_data .vectors .name = 'warpings'
145
+ writer = tvtk .PolyDataWriter (
146
+ file_name = op .abspath (self .inputs .out_warp ))
147
+ writer .set_input_data (out_mesh )
148
+ writer .write ()
149
+ #write_data(out_mesh, op.abspath(self.inputs.out_warp))
146
150
147
151
self ._distance = np .average (errvector , weights = weights )
148
152
return runtime
149
153
150
154
def _list_outputs (self ):
151
155
outputs = self ._outputs ().get ()
152
156
outputs ['out_file' ] = op .abspath (self .inputs .out_file )
157
+ outputs ['out_warp' ] = op .abspath (self .inputs .out_warp )
153
158
outputs ['distance' ] = self ._distance
154
159
return outputs
155
160
0 commit comments