<HTML>
<HEAD>
<TITLE>Re: [Paraview] can't create a valid vti file to read into paraview</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>You should always be able to create a valid vti file by simply loading or creating image data in ParaView (the Wavelet source works well for that), and then writing out a vti file.<BR>
<BR>
If you want further help on what is wrong with your file, it would be helpful to post it. &nbsp;You might also consider contacting the vtk users mailing list too, since the VTK file formats is more of general VTK question.<BR>
<BR>
-Ken<BR>
<BR>
<BR>
On 7/24/09 1:33 PM, &quot;Lawrence M. Lifshitz&quot; &lt;<a href="Lawrence.Lifshitz@umassmed.edu">Lawrence.Lifshitz@umassmed.edu</a>&gt; wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Hi,<BR>
&nbsp;&nbsp;I am trying to write a simple program to convert my image data into vti<BR>
format so I can view it using paraview. &nbsp;I've been using <a href="http://www.vtk.org/VTK/img/file-formats.pdf">http://www.vtk.org/VTK/img/file-formats.pdf</a><BR>
as I guide. &nbsp;But I keep getting an error message when I try to read in the file I create.<BR>
<BR>
<BR>
</SPAN></FONT><FONT FACE="Courier, Courier New"><SPAN STYLE='font-size:12pt'>ERROR: In /builddir/build/BUILD/ParaView-3.4.0/VTK/IO/vtkXMLStructuredDataReader.cxx, line 326<BR>
</SPAN></FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
</SPAN></FONT><FONT FACE="Courier, Courier New"><SPAN STYLE='font-size:12pt'>vtkXMLImageDataReader (0x10844640): Error reading extent 0 511 0 511 0 40 from piece 0<BR>
</SPAN></FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
</SPAN></FONT><FONT FACE="Courier, Courier New"><SPAN STYLE='font-size:12pt'>ERROR: In /builddir/build/BUILD/ParaView-3.4.0/VTK/IO/vtkXMLDataReader.cxx, line 502<BR>
</SPAN></FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
</SPAN></FONT><FONT FACE="Courier, Courier New"><SPAN STYLE='font-size:12pt'>vtkXMLImageDataReader (0x10844640): Cannot read point data array &quot;i2idata&quot; from PointData in piece 0. The data array in the element may be too short.<BR>
</SPAN></FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
When I actually count the bytes in the file they seem correct (i.e, 512*512*41*2, &nbsp;&nbsp;2 since I'm using Int16 and raw data).<BR>
<BR>
I went to the archives and found <a href="http://www.cmake.org/pipermail/paraview/2008-June/008319.html">http://www.cmake.org/pipermail/paraview/2008-June/008319.html</a> which discussed a<BR>
similar issue and has a link to a &quot;valid&quot; vti file (I don't have any other to test with)<BR>
<a href="http://www.paraview.org/pipermail/paraview/attachments/20080611/e2bbb33b/attachment.obj">http://www.paraview.org/pipermail/paraview/attachments/20080611/e2bbb33b/attachment.obj</a><BR>
<BR>
(don't know why the extension wasn't .vti).<BR>
I pulled that over and can read it fine (at least there are no error messages, I don't know what the image is supposed to look like).<BR>
<BR>
Looking at that file it seems to me like there are too many bytes in the raw data, since it seems like it should be 8*4*4 = 128 * 4 bytes per point = 512.<BR>
In the archived article it makes it sound like maybe there are extra bytes of info needed (???) :<BR>
&nbsp;&nbsp;&nbsp;&nbsp;<BR>
&gt;<I> To discover (for it was undocumented) that a 4 byte number of elements<BR>
</I>&gt;<I> should precede each record and should be a BIG ENDIAN integer regardless of<BR>
</I>&gt;<I> the endianness of rest of the binary data was quite a thrill (to say the<BR>
</I>&gt;<I> least!).<BR>
<BR>
or maybe some type of byte alignment issue?<BR>
<BR>
I too am on 64 bit Linux (fedora 11), but I'm compiling 32 bit. &nbsp;I am using the &quot;encoding=&quot;raw&quot; attribute, but using Int16 data.<BR>
<BR>
Thanks for any pointers to how to create these files!<BR>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Larry<BR>
<BR>
</I></SPAN></FONT></BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><I><BR>
</I></SPAN></FONT><FONT SIZE="2"><FONT FACE="Consolas, Courier New, Courier"><SPAN STYLE='font-size:10pt'><BR>
&nbsp;&nbsp;&nbsp;**** &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Kenneth Moreland<BR>
&nbsp;&nbsp;&nbsp;&nbsp;*** &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sandia National Laboratories<BR>
*********** &nbsp;<BR>
*** *** *** &nbsp;email: <a href="kmorel@sandia.gov">kmorel@sandia.gov</a><BR>
** &nbsp;*** &nbsp;** &nbsp;phone: (505) 844-8919<BR>
&nbsp;&nbsp;&nbsp;&nbsp;*** &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;web: &nbsp;&nbsp;<a href="http://www.cs.unm.edu/~kmorel">http://www.cs.unm.edu/~kmorel</a><BR>
</SPAN></FONT></FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
</SPAN></FONT>
</BODY>
</HTML>