<div>Hi Alexandre,</div>
<div><br>Yes, you are right. Thank you. If use TransformMeshFilter, the codes are:<br>&nbsp;</div>
<div>&nbsp;typedef itk::Mesh&lt;double, Dimension, itk::DefaultStaticMeshTraits&lt;double,Dimension,Dimension,double, double&gt;&gt; MeshType;<br>&nbsp;MeshType::Pointer movingMesh&nbsp; = MeshType::New();<br>&nbsp;MeshType::Pointer registeredMesh = MeshType::New();
<br>&nbsp;typedef itk::TransformMeshFilter&lt;MeshType, MeshType, TransformType&gt; MeshTransformFilterType;<br>&nbsp;MeshTransformFilterType::Pointer meshtransformfilter= MeshTransformFilterType::New();<br>&nbsp;movingMesh-&gt;SetPoints(movingPointContainer);
<br>&nbsp;meshtransformfilter-&gt;SetInput(movingMesh);<br>&nbsp;meshtransformfilter-&gt;SetTransform(transform);<br>&nbsp;try <br>&nbsp;{<br>&nbsp;&nbsp;meshtransformfilter-&gt;Update();<br>&nbsp;}<br>&nbsp;catch( itk::ExceptionObject &amp; e )<br>&nbsp;{<br>&nbsp;&nbsp;DisplayITKError(e);
<br>&nbsp;&nbsp;return -1;<br>&nbsp;}<br>&nbsp;registeredMesh = meshtransformfilter-&gt;GetOutput();<br>//then write registeredMesh-&gt;GetPoints() into file</div>
<div>&nbsp;</div>
<div>Now the problem is solved. Basically, the problem is caused by DefaultStaticMeshTraits, which should be tailored to your own data type by explicit declaration. Many thanks to all of you.</div>
<div>&nbsp;</div>
<div>Regards,</div>
<div>Steven</div>
<div><br>On 9/5/07, Alexandre GOUAILLARD &lt;<a href="mailto:hanfei@caltech.edu">hanfei@caltech.edu</a>&gt; wrote:<br>&gt; <br>&gt; Hi steven,<br>&gt; <br>&gt; As for the TransformMeshFilter, you have a lot of errors related to your using a pointset instead of a Mesh.
<br>&gt; Typically, you should not be able to write this:<br>&gt; typedef itk::TransformMeshFilter&lt;PointSetType, PointSetType, TransformType&gt; TransformFilterType;<br>&gt; <br>&gt; You should write this instead<br>&gt; typedef itk::TransformMeshFilter&lt;MeshType, MeshType, TransformType&gt; TransformFilterType;
<br>&gt; <br>&gt; You can mdify your code by creating a mesh, and using its SetPoints() method to attach your instance of a Poinset.<br>&gt; <br>&gt; You might want to instanciate the meshtraits manually to avoid the pointype problem.
<br>&gt; <br>&gt; Alex. <br>&gt; <br>&gt; <br><br>&nbsp;</div>