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