Hello David,<br><br>Thanks for your help! <br>I&#39;ve found the problem. <br>vtkVolume16Reader reads in 16 bit unsignedshort int. It can&#39;t be convert into double!<br>When I tried imageData-&gt;SetScalarTypeToDouble(); Things went wrong.<br>
But imageData-&gt;SetScalarTypeToUnsignedShort(); works fine.<br>Thanks.<br><br>Cheng<br><br><div class="gmail_quote">2012/2/11 David Doria <span dir="ltr">&lt;<a href="mailto:daviddoria@gmail.com">daviddoria@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_quote"><div><div class="h5">On Fri, Feb 10, 2012 at 1:03 PM, cc cc <span dir="ltr">&lt;<a href="mailto:cctsinghua@gmail.com" target="_blank">cctsinghua@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello,<br><br>I want to get value of each point. The data is from vtkVolume16Reader, the typical header frequently seen in vtk, used in vtkMarchingCubes. Below is vtkVolume16Reader from sample code.<br>    vtkVolume16Reader *v16 = vtkVolume16Reader::New();<br>


    v16-&gt;SetDataDimensions(64,64);<br>    v16-&gt;GetOutput()-&gt;SetOrigin(0.0,0.0,0.0);<br>    v16-&gt;SetDataByteOrderToLittleEndian();<br>    v16-&gt;SetFilePrefix(&quot;/.../VTK/VTKData/Data/headsq/quarter&quot;);<br>


    v16-&gt;SetImageRange(1,93);<br>    v16-&gt;SetDataSpacing(3.2,3.2,1.5);<br>    v16-&gt;Update();<br>But how can I get value on each vertex? Please help. Best wishes.<br><br>Cheng<br></blockquote><div><br></div></div>
</div><div>
You should get the output of the filter as a vtkImageData:</div><div><br></div><div>vtkImageData* image = v16-&gt;GetOutput();</div><div><br></div><div>Then you can access the data like this: </div><a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/ImageData/IterateImageData" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Cxx/ImageData/IterateImageData</a><span class="HOEnZb"><font color="#888888"><br clear="all">

<br><div>David </div></font></span></div>
</blockquote></div><br>