[vtkusers] Binary File Format for VTK

Kevin Wright krw at viz-solutions.com
Tue Jan 22 13:32:53 EST 2002


At 06:25 PM 1/22/2002 +0000, you wrote:
>I have successfully created an ASCII VTK file output stream for my code
>but have failed to get this to work for binary when loading the data
>into MayaVi.
>
>Help! Please see code fragment below with the old ascii stuff commented
>out.
>
>Has anybody written an ASCII to BINARY VTK converter?
>    fprintf(maya_file_unit, "# vtk DataFile Version 2.0\n");
>    fprintf(maya_file_unit, "Title\n");
>    fprintf(maya_file_unit, "BINARY\n");
>    fprintf(maya_file_unit, " \n");
>    fprintf(maya_file_unit, " \n");
>    fprintf(maya_file_unit, "DATASET UNSTRUCTURED_GRID\n");

You're writing out two newline characters after BINARY.  I've always used 
vtk DataFile Version 3.0, so this may be different, but I've never put any 
blank lines between BINARY and the dataset type.  Perhaps this is your problem?

Kevin.





More information about the vtkusers mailing list