[Paraview] VTU File Format wih raw Data

Brad King brad.king at kitware.com
Thu Oct 18 09:12:34 EDT 2007


Sören Freudiger wrote:
> Is it possible to use “raw” data inside the VTU files?

Yes.

> Something like:
> 
> <VTKFile type="UnstructuredGrid" version="0.1" byte_order="LittleEndian">
>   <UnstructuredGrid>
>     <Piece NumberOfPoints="6" NumberOfCells="1">
>       <Points>
>         <DataArray type = " Float32" NumberOfComponents="3" format="appended" offset=”0” />
>       </Points>
>       <Cells>
>         <DataArray type="Int32" Name="connectivity" format="appended" offset=”123” />
>         <DataArray type="Int32" Name="offsets" format="appended" offset=”234” />          
>         <DataArray type="UInt8" Name="types" format="appended" offset=”345” />
>       </Cells>
>       <PointData>
>         <DataArray type="float" Name="stress" format="appended" offset=”567” />
>       </PointData>
>     </Piece>
>   </UnstructuredGrid>
>   <AppendedData encoding="raw">
> _...  
>   </AppendedData>
> </VTKFile>
> 
> I cannot find a concrete example. 
> Is is right that I the raw data is organized somehow like that
> 
> _(size=#points*3*sizeof(Float32()(data of array)(size of array1)(size=8(oct)*#cells*sizeof(Int32()(connectivity array)…
> 
> If so, has the length to be stored in same format as Data (Int32,Float32, etc.).
> Is it possible to mix data types or do they all have to be in same format (e.g. Float32)

The format is

_NNNN<data>NNNN<data>NNNN<data>
 ^         ^         ^
 1         2         3

where each "NNNN" is an unsigned 32-bit integer, and <data> consists of
a number of bytes equal to the preceding NNNN value.  The corresponding
DataArray elements must have format="appended" and offset attributes
equal to the following:

1.) offset="0"
2.) offset="(4+NNNN1)"
3.) offset="(4+NNNN1+4+NNNN2)"

These blocks may be in any order as long as the corresponding offset
elements point to the right spot.  Each array can have its own type
specified in its DataArray element.  The byte order of all values (both
in the NNNN header and in the data) is that specified by the byte_order
attribute at the top of the file.

-Brad


More information about the ParaView mailing list