<div><br><div class="gmail_quote">On Tue, Sep 28, 2010 at 12:24 AM, XuXing <span dir="ltr">&lt;<a href="mailto:cool2201@sina.com">cool2201@sina.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div lang="ZH-CN" link="blue" vlink="purple"><div><p class="MsoNormal"><span lang="EN-US">Hi, all</span></p><p class="MsoNormal"><span lang="EN-US">   I got a problem when I try to use vtkMarchingCubes to visualize my image, I can’t set the color of the image, here is part of my code:</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p><p class="MsoNormal" style="text-indent:21.0pt"><span lang="EN-US">vtkPolyData* polydata = vtkPolyData::New();</span></p><p class="MsoNormal"><span lang="EN-US">         polydata = marchingCubes-&gt;GetOutput();</span></p>
<p class="MsoNormal"><span lang="EN-US">         vtkPolyDataMapper *polydataMapper = vtkPolyDataMapper::New();</span></p><p class="MsoNormal"><span lang="EN-US">         polydataMapper-&gt;SetInput(polydata);</span></p><p class="MsoNormal">
<span lang="EN-US">         vtkActor *polydataActor = vtkActor::New();  </span></p><p class="MsoNormal"><span lang="EN-US">         polydataActor-&gt;SetMapper(polydataMapper);</span></p><p class="MsoNormal"><span lang="EN-US">         polydataActor-&gt;GetProperty()-&gt;SetRepresentationToSurface();</span></p>
<p class="MsoNormal"><span lang="EN-US">         polydataActor-&gt;GetProperty()-&gt;SetColor(0,1,0);</span></p><p class="MsoNormal"><span lang="EN-US"> </span></p><p class="MsoNormal"><span lang="EN-US">no matter what color I set, it always show it blue.</span></p>
<p class="MsoNormal"><span lang="EN-US">Any advice will be appreciated, thank you!</span></p><p class="MsoNormal"><span lang="EN-US"> </span></p><font color="#888888"><p class="MsoNormal"><span lang="EN-US">XuXing</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p></font></div></div></blockquote><div> </div>Try <div><br></div><div>marchingCubes-&gt;ComputeScalarsOff()</div><div><br></div><div>David </div></div><br></div>