[Insight-users] ExceptionObject error while saving as VTK

Luis Ibanez luis.ibanez at kitware.com
Mon, 12 Apr 2004 16:31:54 -0400


Hi Alam,

Thanks for sending your VTK files.

The reason why the vtk2itk.cxx program seg. faults
with your files is that this program expect a
vtkDataSet while your files contain vtkPolyData
structures.

A new example has been added in order to illustrate
how to convert VTK files as yours into an itk::Mesh.

You will find this new example under:

    InsightApplications/Auxiliary/vtk
                   vtkPolyDataToITKMesh.cxx


It expects to receive a .vtk file (with a vtkPolyData)
as input. The code is expecting your vtkPolyData to
contain only: TriangleStrips and Triangles. Any other
cells are not being copied. However nothing prevents
you from adding such other cells.

This code ran fine with both of your datasets. You may
want to verify the topology of the resulting itk::Mesh,
since this is just a first commit of the code and may
still need some tunning.


Please let us know if you encounter any problems,


   Thanks


     Luis


----------------------
Alam, Mohammed wrote:
> Hi Luis:
> Thanks for your reply, but I am past this step. I am trying to use ITK/ITKApplication/VTK/vtk2itk.cxx to convert an ITK 3D mesh into a unstructered VTK grid and then display/Save it (as per Gulsheens previous mails).
>  
> This morning I have mailed you, our vtk object which gives run time error with vtk2itk.cxx. We also tried using another vtk object from ITK dataset (weldedSpheres.vtk) and it resulted in similar error. 
>  
> Please let me know if there is a bug in the program or if there is somethign wrong with our VTK objects. I am also attaching my sample of vtk object (ring1.vtk) and vtk object from itk dataset (weldedSphere.vtk).
>  
> Thank you
> Alam
> 
> 
> ------------------------------------------------------------------------
> 
> # vtk DataFile Version 2.0
> vtk output
> ASCII
> DATASET POLYDATA
> POINTS 2312 float
> 0.263107 0 0.425176 0.33131 0 0.374478 0.389942 0 0.312962