[vtkusers] problem reading .vtk file: error reading ascii file.possible mismatch of datasize with declaration

Swetha Sharma swetha.bsharma at gmail.com
Fri Jul 28 06:25:21 EDT 2017


Hi All,

  I am new to vtk . The following is the format of my vtk file

# vtk DataFile Version 2.0
File written by itkVTKPolyDataWriter
ASCII
DATASET POLYDATA
POINTS 28510 float
105.668 85.3688 60.1681
105.857 85.1791 60.1681
105.857 85.3688 59.8223
106.047 85.3688 60.1681
105.668 85.7482 60.1681
105.857 85.7482 59.8223
106.047 85.5585 59.8223
106.237 85.5585 60.1681
106.237 85.7482 59.8223
106.426 85.7482 60.1681
105.288 86.1277 60.1681


I am trying to read it in vtk with the following code:

vtkSmartPointer<vtkGenericDataObjectReader> reader =
      vtkSmartPointer<vtkGenericDataObjectReader>::New();
  std::cout<<"filename:"<<argv[1]<<"\n";
  reader->SetFileName(argv[1]);


  reader->Update();


 I am getting an error: error reading ascii file.possible mismatch of
datasize with declaration. How do I fix this?

-swetha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170728/b2d2198e/attachment.html>


More information about the vtkusers mailing list