[Insight-users] Writing mesh to Metafile
Matilde Gonzalez Preciado
matilde.gonzalez.preciado at gmail.com
Mon May 18 08:34:19 EDT 2009
Hi,
I am working with a IndexedTriangleMesh and I want to write it in a vtk file
in order to visualize it easily. I am using itkMeshTovtkPolydata but
SetInput requires a itk::Mesh, I would like to know if it is possible to
convert a IndexedTriangleMesh into a itk::mesh in order to be able to use
this class.
My code is:
typedef itk::Vector<double, 2> PixelType;
typedef unsigned short IndexType;
typedef itk::IndexedTriangleMesh<PixelType, IndexType> OutputMeshType;
itkMeshTovtkPolyData *itkTovtkPolyData = new itkMeshTovtkPolyData();
vtkPolyData* polyData = vtkPolyData::New();
OutputMeshType::Pointer resultMesh ;
resultMesh = ssmCalculator->GetResampledOutputMesh( i ) ;
//Here resultMesh must be itk::Mesh and not itk::IndexedTriangleMesh
itkTovtkPolyData ->SetInput(resultMesh);
polyData = itkTovtkPolyData->GetOutput();
Thank you in advance
--
Matilde GONZALEZ
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090518/dd2f2d5d/attachment.htm>
More information about the Insight-users
mailing list