<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hello,<br>
<br>
the solution might be to append your data as<br>
<br>
< DataArray ... format="appended"><br>
</DataArray><br>
< AppendedData encoding="raw"><br>
_NNNNData <br>
</AppendedData><br>
where you should replace NNNN with a four <br>
byte integer containing the number of bytes <br>
in the data array as 4 chars.<br>
Setting the encoding to "raw" tells ParaView, that<br>
the data is simply a stream of bytes rather than <br>
base64 encoded.<br>
If you want to write Image I can supply a small<br>
writer project for 2D data.<br>
<br>
Thorsten<br>
<br>
David Mulholland schrieb:
<blockquote cite="mid:94F73CF1F23B43C096CCE910A36EC616@dm105"
type="cite">
<meta content="text/html;charset=iso-8859-1" http-equiv="Content-Type">
<meta name="GENERATOR" content="MSHTML 8.00.7000.0">
<div>Hello,<br>
<br>
I am currently trying to write my own quick output routine to generate
a <br>
binary file using C++. I am currently trying to avoid having to use the
vtk <br>
libraries because I only need a very basic output that doesn't change
much. <br>
I so far have the ASCII output working no problem but I can't get the
binary <br>
working.<br>
<br>
I am using file.write() function to output the binary data and that
seems to <br>
be working no problem and when used in a legacy format application it
works <br>
perfectly except that the data is LittleEndian instead of BigEndian.
That's <br>
why I have moved to BigEndian because I don't want to have to make the <br>
output routine for the data anymore complicated that file.write.<br>
<br>
I started using the xml format and considering my output is raw binary
and <br>
not base64 I changed it to be in the AppendedData section instead of <br>
DataArray. It still isn't working right, I get the following error when
I <br>
try to load in ParaView:<br>
<br>
ERROR: In ..\..\..\ParaView3\VTK\IO\vtkXMLStructuredDataReader.cxx,
line 349<br>
vtkXMLImageDataReader (0ADEC7F8): Error reading extent 0 422 0 242 0 1
from <br>
piece 0<br>
<br>
<br>
ERROR: In ..\..\..\ParaView3\VTK\IO\vtkXMLDataReader.cxx, line 537<br>
vtkXMLImageDataReader (0ADEC7F8): Cannot read cell data array
"pressure" <br>
from PointData in piece 0. The data array in the element may be too
short.<br>
<br>
The format of my output file is as follows:<br>
<br>
<?xml version="1.0"?><br>
<VTKFile type="ImageData" version="0.1" byte_order="LittleEndian"><br>
<ImageData WholeExtent="0 422 0 242 0 1" Origin="0 0 0" Spacing="1 1
1"><br>
<Piece Extent="0 422 0 242 0 1"><br>
<PointData><br>
</PointData><br>
<CellData Scalars="pressure"><br>
<DataArray type="Float32" Name="pressure" format="appended"
offset="0"/><br>
</CellData><br>
</Piece><br>
</ImageData><br>
<AppendedData encoding="raw"><br>
_BINARYDATA<br>
</AppendedData><br>
</VTKFile><br>
<br>
Note following an error message I have added an _ at the start of the
binary <br>
data. Is this required?<br>
<br>
One final thing, when using appended data, how do you calculate what
the <br>
offset should be?<br>
<br>
Thanks<br>
David</div>
<pre wrap="">
<hr size="4" width="90%">
_______________________________________________
Powered by <a class="moz-txt-link-abbreviated" href="http://www.kitware.com">www.kitware.com</a>
Visit other Kitware open-source projects at <a class="moz-txt-link-freetext" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a>
Please keep messages on-topic and check the ParaView Wiki at: <a class="moz-txt-link-freetext" href="http://paraview.org/Wiki/ParaView">http://paraview.org/Wiki/ParaView</a>
Follow this link to subscribe/unsubscribe:
<a class="moz-txt-link-freetext" href="http://www.paraview.org/mailman/listinfo/paraview">http://www.paraview.org/mailman/listinfo/paraview</a>
</pre>
</blockquote>
<br>
</body>
</html>