<div dir="ltr">It seems like paraview is expecting vtkXMLImageData, so you are getting vtkXMLReader related error.Try using vtkXMLImageDataWriter and vtkXMLImageDataReader.<br><br>Jothy <br><br><div class="gmail_quote">On Mon, Mar 29, 2010 at 5:46 PM, Erik Türke <span dir="ltr">&lt;<a href="mailto:tuerke@cbs.mpg.de">tuerke@cbs.mpg.de</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">





<div bgcolor="#ffffff" text="#000000">
Hi!<br>
<br>
I am new to vtk.<br>
<br>
I am using the vtkImageImport class to view a non vtk object:<br>
<br>
importer-&gt;SetImportVoidPointer(&amp;myAdapter-&gt;m_ImageISIS-&gt;voxel&lt;short&gt;(0,0,0,0));<br>
importer-&gt;SetWholeExtent(0,dimensions[0]-1,0,dimensions[1]-1,0,dimensions[2]-1);<br>
importer-&gt;SetDataExtentToWholeExtent();<br>
importer-&gt;SetDataScalarTypeToShort();<br>
importer-&gt;Update();<br>
viewer-&gt;SetInputConnection(importer-&gt;GetOutputPort());<br>
viewer-&gt;SetZSlice(100);<br>
viewer-&gt;Render();<br>
sleep(5);<br>
<br>
This works fine. The second thing i want to do is safe the data as a
vtk image and open it with paraview:<br>
<br>
vtkImageWriter* writer = vtkImageWriter::New();<br>
writer-&gt;SetFileDimensionality(3);<br>
writer-&gt;SetInputConnection(importer-&gt;GetOutputPort());<br>
writer-&gt;SetFileName(&quot;test.vtk&quot;);<br>
writer-&gt;UpdateWholeExtent();<br>
writer-&gt;Write();<br>
<br>
The file is safed, but i can not open it with paraview. There is always
a message: &quot;a reader for ... could not be found. please choose one&quot;. <br>
And when i choose vtk image reader the message:<br>
&quot; 
<p style="margin: 0px; text-indent: 0px;"><span style="font-family: &#39;Courier&#39;; font-size: 8pt; color: rgb(128, 0, 0);">index
0: not well-formed (invalid token)</span></p>
<p style="margin: 0px; text-indent: 0px; font-family: &#39;Courier&#39;; font-size: 8pt; color: rgb(128, 0, 0);"></p>
<p style="margin: 0px; text-indent: 0px; font-family: &#39;Courier&#39;; font-size: 8pt; color: rgb(128, 0, 0);"></p>
<p style="margin: 0px; text-indent: 0px;"><span style="font-family: &#39;Courier&#39;; font-size: 8pt; color: rgb(128, 0, 0);">ERROR:
In /build/buildd/paraview-3.4.0/VTK/IO/vtkXMLReader.cxx, line 360</span></p>
<p style="margin: 0px; text-indent: 0px;"><span style="font-family: &#39;Courier&#39;; font-size: 8pt; color: rgb(128, 0, 0);">vtkXMLImageDataReader
(0x24b7720): Error parsing input file. ReadXMLInformation aborting.</span></p>
<p style="margin: 0px; text-indent: 0px; font-family: &#39;Courier&#39;; font-size: 8pt; color: rgb(128, 0, 0);"></p>
<p style="margin: 0px; text-indent: 0px; font-family: &#39;Courier&#39;; font-size: 8pt; color: rgb(128, 0, 0);"></p>
<p style="margin: 0px; text-indent: 0px;"><span style="font-family: &#39;Courier&#39;; font-size: 8pt; color: rgb(128, 0, 0);">ERROR:
In /build/buildd/paraview-3.4.0/VTK/Filtering/vtkExecutive.cxx, line 757</span></p>
<p style="margin: 0px; text-indent: 0px;"><span style="font-family: &#39;Courier&#39;; font-size: 8pt; color: rgb(128, 0, 0);">vtkCompositeDataPipeline
(0x24c2030): Algorithm vtkXMLImageDataReader(0x24b7720) returned
failure for request: vtkInformation (0x24dc890)</span></p>
<p style="margin: 0px; text-indent: 0px;"><span style="font-family: &#39;Courier&#39;; font-size: 8pt; color: rgb(128, 0, 0);">
Debug: Off</span></p>
<p style="margin: 0px; text-indent: 0px;"><span style="font-family: &#39;Courier&#39;; font-size: 8pt; color: rgb(128, 0, 0);">
Modified Time: 79214</span></p>
<p style="margin: 0px; text-indent: 0px;"><span style="font-family: &#39;Courier&#39;; font-size: 8pt; color: rgb(128, 0, 0);">
Reference Count: 1</span></p>
<p style="margin: 0px; text-indent: 0px;"><span style="font-family: &#39;Courier&#39;; font-size: 8pt; color: rgb(128, 0, 0);">
Registered Events: (none)</span></p>
<p style="margin: 0px; text-indent: 0px;"><span style="font-family: &#39;Courier&#39;; font-size: 8pt; color: rgb(128, 0, 0);">
Request: REQUEST_INFORMATION</span></p>
<p style="margin: 0px; text-indent: 0px;"><span style="font-family: &#39;Courier&#39;; font-size: 8pt; color: rgb(128, 0, 0);">
ALGORITHM_AFTER_FORWARD: 1</span></p>
<p style="margin: 0px; text-indent: 0px;"><span style="font-family: &#39;Courier&#39;; font-size: 8pt; color: rgb(128, 0, 0);">
FORWARD_DIRECTION: 0&quot;<br>
</span></p>
<p style="margin: 0px; text-indent: 0px;"><br>
<span style="font-family: &#39;Courier&#39;; font-size: 8pt; color: rgb(128, 0, 0);"></span></p>
<p style="margin: 0px; text-indent: 0px;"><span style="font-family: &#39;Courier&#39;; font-size: 8pt; color: rgb(128, 0, 0);"><br>
</span></p>
appears.<br>
<br>
The third thing i want to do is store the data to a vtkImageData object.<br>
Is there any possibility to directly forward the vtkImageImport (or
pointer of the first element of the data array) to the vtkImageData, so
i do not have to do it voxel by voxel? Because this needs a lot of time
for big data.<br>
<br>
Thanks for your help!<br>
<br>
cheers<br>
<p style="margin: 0px; text-indent: 0px;"><span style="font-family: &#39;Courier&#39;; font-size: 8pt; color: rgb(128, 0, 0);"></span><span style="font-family: &#39;Courier&#39;; font-size: 8pt; color: rgb(128, 0, 0);"></span></p>

<p style="margin: 0px; text-indent: 0px; font-family: &#39;Courier&#39;; font-size: 8pt; color: rgb(128, 0, 0);"></p>
</div>

<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div>