[Insight-users] writing mesh

THOMAS Diego thomas.diego at ifp.fr
Tue Aug 28 11:55:37 EDT 2007


Hi,

I used the itk extractsurface filter and i would like to visualize the result in paraview.
I tried to use the spatial object writer to record the mesh, but I can't read the file in paraview (paraview message: could not find an appropriate reader).
here is my code:

	typedef itk::DefaultDynamicMeshTraits< float,3,3> MeshTrait;
	typedef itk::Mesh<float,3,MeshTrait> MeshType;
	typedef itk::BinaryMask3DMeshSource< Image3D, MeshType > MeshSourceType;
	typedef itk::SpatialObjectWriter<3,float,MeshTrait> WriterType;
	typedef itk::MeshSpatialObject<MeshType> MeshSpatialObjectType;

	MeshType::Pointer mesh = meshSource->GetOutput();
	
	MeshSpatialObjectType::Pointer meshSO = MeshSpatialObjectType::New();
	meshSO->SetMesh(mesh);
	
	WriterType::Pointer writer = WriterType::New();
	writer->SetInput(meshSO);
	writer->SetFileName("mesh.vtk");
	writer->Update();


What am I missing?

thanks in advance,

regards

Diego.
__________________________

Ce message (et toutes ses pièces jointes éventuelles) est confidentiel et établi à l'intention exclusive de ses destinataires. Toute utilisation de ce message non conforme à sa destination, toute diffusion ou toute publication, totale ou partielle, est interdite, sauf autorisation expresse. L'IFP décline toute responsabilité au titre de ce message.

This message and any attachments (the message) are confidential and intended solely for the addressees. Any unauthorised use or dissemination is prohibited. IFP should not be liable for this message.

Visitez notre site Web / Visit our web site : http://www.ifp.fr
__________________________


More information about the Insight-users mailing list