[Insight-users] itkVTKPolyDataReader example issues

David Doria daviddoria+itk at gmail.com
Sun Aug 9 10:41:36 EDT 2009


I tried to put together a simple example of itkVTKPolyDataReader (which I'd
recommend adding to the Examples/Review folder).  However, it seems to have
some problems:

http://www.rpi.edu/~doriad/ITK_List/itkVTKPolyDataReader/

These vtk files were all created using Paraview using the "Save Data ->
Legacy VTK" from a vtp file loaded in paraview.

When run on BunnyMesh.vtk it hangs on "Trying to read...".

After a bit of debugging it seems to never find the POLYGONS line (lines 117
- 120 in itkVTKPolyDataReader.txx)
  while( !inputFile.eof() && line.find("POLYGONS") == std::string::npos )
    {
    std::getline( inputFile, line );
    }

When run on BunnyPoints.vtk (points only, no connectivity), it does the same
thing.

When run on BunnyPointsASCII.vtk, it says:

terminate called after throwing an instance of 'std::out_of_range'
  what():  basic_string::basic_string
Aborted

It says the same thing when called on BunnyPoints.vtp file - but I know it
is not designed to read vtp, so I'm assuming it is just also not designed to
read ascii vtk.

I think we need to look into making this reader compatible with binary (and
maybe ascii, too?) files exported as vtk from paraview.

Thanks,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090809/b6958280/attachment.htm>


More information about the Insight-users mailing list