[Insight-users] writing mesh

Luis Ibanez luis.ibanez at kitware.com
Tue Aug 28 12:57:57 EDT 2007


Hi Thomas,

Then Mesh writer of Spatial Objects doesn't use the same
fileformat as VTK.

The class that you may want to use is in the directory

          Insight/Code/Review
             itkVTKPolyDataWriter.h
             itkVTKPolyDataWriter.txx


Note however, that a much better way to proceed is to
use the Antialias filter in your binary image, and then
save the smoothed image as a MetaImage or a .VTK image.

Then read the image in ParaView, and use the Contour
filter in ParaView for generating the surface.



     Regards,


        Luis


-------------------
THOMAS Diego wrote:
> 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
> __________________________
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 


More information about the Insight-users mailing list