<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: arial;color: #000000">Thank you. I will figure out my problems with https://github.com/Kitware/VTK/blob/master/Rendering/Core/vtkHardwareSelector.cxx .<blockquote class="history_container" type="cite" style="border-left-style: solid;border-width: 1px;margin-top: 20px;margin-left: 0px;padding-left: 10px;min-width: 500px">
<p style="color: #AAAAAA; margin-top: 10px;">On 11/30/2016 10:37:17 PM, David E DeMarle <dave.demarle@kitware.com> wrote:</p><div dir="ltr">You might also want to investigate vtkHardwareSelector. It internally does what you are trying to do.<div>Another approach is the more recent vtkValuePass, which is more general but if you associate an index array with the cells you can make it do the same thing.</div><div><br></div><div>See the regression test suite for examples of use.</div><div><br></div><div><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature">David E DeMarle<br>Kitware, Inc.<br>R&D Engineer<br>21 Corporate Drive<br>Clifton Park, NY 12065-8662<br>Phone: 518-881-4909</div></div>
<br><div class="gmail_quote">On Wed, Nov 30, 2016 at 8:29 AM, Cory Quammen <span dir="ltr"><<a href="mailto:cory.quammen@kitware.com" target="_blank">cory.quammen@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0 0 0 .8ex;border-left: 1px #ccc solid;padding-left: 1ex;min-width: 500px">Hi,<br>
<br>
It seems like you are doing the right things and should expect to get<br>
the color values you set. Could you attach a small image showing the<br>
output you get and maybe highlight a cell that does not have the<br>
expected color? Are the colors way off from what you expect, or just<br>
slightly different?<br>
<br>
Thanks,<br>
Cory<br>
<div><div class="h5"><br>
On Wed, Nov 30, 2016 at 2:20 AM, Jaehyun Jang <<a href="mailto:sysexits@gmail.com">sysexits@gmail.com</a>> wrote:<br>
> Dear vtk users,<br>
><br>
> I am trying to these tasks using vtkPolyDataMapper with<br>
> vtkUnsignedCharArray, vtkRenderer, vtkRenderWindow to get pixel count of a<br>
> specific cell<br>
><br>
> 1. Translate index value(within 1 ~ 16777215) to R, G, B value (using R =<br>
> idx & 255, G = (idx >> 8) & 255, B = (idx >> 16) & 255<br>
> 2. From all points of each cell, assigning those color values into<br>
> vtkUnsignedCharArray with SetTupleValue(point index of same cell, color)<br>
> (the forth value of color is always 255)<br>
> - i.e, All different cells have different RGB value. (If I set only 50 cells<br>
> in the model, only 50 cells have distinct color in 1 ~ 50)<br>
> 3. Setting the model using vtkProperty with these settings<br>
> m_actor->GetProperty()-><wbr>BackfaceCullingOn();<br>
> m_actor->GetProperty()-><wbr>LightingOff();<br>
> m_actor->GetProperty()-><wbr>ShadingOff();<br>
> m_actor->GetProperty()-><wbr>SetInterpolationToFlat();<br>
><br>
> 4. Render this model using vtkRenderWindow with these settings<br>
> renderwindow-><wbr>SetOffScreenRendering(1);<br>
> renderwindow->AddRenderer(<wbr>renderer);<br>
> renderwindow->SetSize(600, 600);<br>
> renderwindow->Render()<br>
> 5. Get vtkImageData using vtkWindowToImageFilter and access GetScalarPointer<br>
> 6. Translate RGB to index and count it.<br>
><br>
> However, RGB values translate wrong indices which I did not expect, I want<br>
> to know how to set my renderer or actor without interpolation and shading to<br>
> get the expected color.<br>
><br>
> Thanks.<br>
><br>
> --<br>
> Jaehyun Jang<br>
> Master's candidate<br>
> School of Computing, KAIST<br>
> 291, Daehak-ro, Yuseong-gu, Daejeon<br>
> E3-1, 2413 STE<br>
> Computer Graphics and Visualization Lab<br>
> Resume | Github | Personal<br>
><br>
</div></div>> ______________________________<wbr>_________________<br>
> Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the VTK FAQ at:<br>
> <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_<wbr>FAQ</a><br>
><br>
> Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtkusers</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/vtkusers</a><br>
><br>
<br>
<br>
<br>
--<br>
Cory Quammen<br>
Staff R&D Engineer<br>
Kitware, Inc.<br>
______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>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" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_<wbr>FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/vtkusers</a><br>
</blockquote></div><br></div>
</blockquote></div>