[vtk-developers] LEgacy VTK File Formats

Randall Hand randall.hand at gmail.com
Mon Jan 29 12:48:22 EST 2007


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20070129/971f7e53/attachment.html>


More information about the vtk-developers mailing list