[vtkusers] LEgacy VTK File Formats

Berk Geveci berk.geveci at kitware.com
Mon Jan 29 13:17:33 EST 2007


The legacy files are always big endian.  On a little endian machine,
the VTK writers take care of byte swapping for you. This is a
limitation of the file format. Tt does not support meta-information
for the endianness.

On 1/29/07, Randall Hand <randall.hand at gmail.com> wrote:
> I'm working with some legacy VTK File Format stuff, writing it from Fortran
> Code.  I'm trying to write it in Binary (for Performance & Space reasons),
> but I've run into a s urprising hiccup.
>
> The file-formats.pdf file shown on the VTK.org website says that the file
> readers can handle reading either BigEndian or LittleEndian data.  In
> reality, however, it seems that (on my X86 Little-Endian Machine, which is
> currently the predominant architecture in the Big vs Little Endian
> Architectures, right) I still have to manually byte-swap everything before I
> write it because in the readers there is a hard-coded call to vtkByteSwap
> that I seem unable to bypass.
>
> For a test I simply wrote out (in C, with fprintf's and fwrite's) a simple
> 3-point, 1-cell Polygonal Dataset in Binary.  It segfaults Paraview & VTK
> every time I try to read it. If I byte-swap all my ints & floats (Point
> locations, point ID's, scalar data) then it works.
>
> So I have to byte-swap all my data to write it out, then wait for VTK to
> byte-swap it again when it reads it in?  Shouldn't this be an "option", and
> not a "requirement" ?  Or have I missed something..
>
> --
> ----------------------------------------
> Randall Hand
> Visualization Scientist
> ERDC MSRC-ITL
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
>


-- 
 Berk Geveci
 Kitware Inc.
 28 Corporate Drive
 Clifton Park, NY, 12065



More information about the vtkusers mailing list