Hi,<br><br>I see that you use a vtkDataSetMapper. vtkDataSet is a high level class in the vtk hierarchy that represents data. Therefore, the render process is not able to &quot;choose&quot; a better specialized rendering, e.g is it a mesh or a volume or a graph or ... ?<br>
<br>Take a look at a vtkVolumeMapper for a volume rendering, or the widget vtkmagePlaneWidget if you wish to slice the data.<br><br>Hope that helps,<br>Jerome<br><br><div class="gmail_quote">2009/6/4 -Daniel- <span dir="ltr">&lt;<a href="mailto:dk-80@gmx.de">dk-80@gmx.de</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im"><br>
Hello,<br>
<br>
I wrote in my last message<br>
&gt;     reader.SetDataScalarTypeToUnsignedChar();<br>
but the raw format is &quot;16bits unsigned&quot;. &lt;Thanks burlen&gt;<br>
</div>Therefore I changed this to:<br>
      reader.SetDataScalarTypeToUnsignedShort();<br>
<div class="im"><br>
But that won&#39;t solve my case. The result is a colorized cube.<br>
</div><div class="im">Please look at the attached picture.<br>
</div><a href="http://www.nabble.com/file/p23875911/snapshot_1.jpg" target="_blank">http://www.nabble.com/file/p23875911/snapshot_1.jpg</a> snapshot_1.jpg<br>
<div class="im"><br>
Any ideas about a Solution is welcomed, thanks!<br>
<br>
<br>
<br>
</div><div><div></div><div class="h5">-Daniel- wrote:<br>
&gt;<br>
&gt; Hi all,<br>
&gt;<br>
&gt; I want to read a 3D raw file (512x512x151) of a head with vtkImageReader.<br>
&gt; But the result is a cube and this is wrong. It should be a 3D volume.<br>
&gt; Please look at the attached picture.<br>
&gt;<br>
&gt; information about this raw file:<br>
&gt;       16bits unsigned<br>
&gt;         BigEndian<br>
&gt;         min 0 max 4096 (12 bits)<br>
&gt;       Dimensions: 512x512x151<br>
&gt;       voxel size: 0.4863 0.4863 1 (mm)<br>
&gt;<br>
&gt; My java-code is following:<br>
&gt;       vtkImageReader reader = new vtkImageReader();<br>
&gt;       reader.SetFileName(file);<br>
&gt;       reader.SetFileDimensionality(3);<br>
&gt;       reader.SetDataExtent(0,511,0,511,0,150);<br>
&gt;       reader.SetDataSpacing(0.4863, 0.4863, 1);<br>
&gt;       reader.SetDataByteOrderToBigEndian();<br>
&gt;       reader.SetDataScalarTypeToUnsignedChar();<br>
&gt;       reader.Update();<br>
&gt;<br>
&gt;       vtkDataSetMapper map = new vtkDataSetMapper();<br>
&gt;       map.SetInputConnection(reader.GetOutputPort());<br>
&gt;<br>
&gt;<br>
&gt; what&#39;s wrong in my code? and how I can create a volume?<br>
&gt; thanks in advance,<br>
&gt;<br>
&gt; Daniel<br>
&gt;<br>
&gt; --<br>
&gt; GMX FreeDSL mit DSL 6.000 Flatrate und Telefonanschluss nur 17,95<br>
&gt; Euro/mtl.!<br>
&gt; <a href="http://dslspecial.gmx.de/freedsl-aktionspreis/?ac=OM.AD.PD003K11308T4569a" target="_blank">http://dslspecial.gmx.de/freedsl-aktionspreis/?ac=OM.AD.PD003K11308T4569a</a><br>
&gt;<br>
&gt;<br>
</div></div><div class="im">&gt; _______________________________________________<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the VTK FAQ at:<br>
&gt; <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
&gt;<br>
&gt;<br>
<br>
</div><font color="#888888">--<br>
View this message in context: <a href="http://www.nabble.com/3D-volume-problem-with-vtkImageReader-reading-RAW-file-tp23870080p23875911.html" target="_blank">http://www.nabble.com/3D-volume-problem-with-vtkImageReader-reading-RAW-file-tp23870080p23875911.html</a><br>

</font><div><div></div><div class="h5">Sent from the VTK - Users mailing list archive at Nabble.com.<br>
<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>
</div></div></blockquote></div><br>