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

kenichiro yoshimi rccm.kyoshimi at gmail.com
Mon Jul 31 07:38:05 EDT 2017


Hi Swetha,

Your code may not be wrong. I regret to say that there is no way to
know if the file can be read.

I highly recommend that you look into a PDF of VTK file formats.
http://www.vtk.org/wp-content/uploads/2015/04/file-formats.pdf

Regards

2017-07-28 19:25 GMT+09:00 Swetha Sharma <swetha.bsharma at gmail.com>:
> 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
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>


More information about the vtkusers mailing list