<div dir="ltr">Did you make sure none of the points were shared between cells? That would cause issues. <div><br></div><div>Other than that you want</div><div><br></div><div>renWin->SetMultisamples(0);  // MSAA will create interpolated pixels</div><div>actor->GetProperty()->SetAmbient(1.0)<br></div><div>actor->GetProperty()->SetDiffuse(0.0)<br></div><div>actor->GetProperty()->SetSpecular(0.0)<br></div><div><br></div><div>and you should be good. Interpolation **should** be irrelevant if the cell's points have the same color.</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 30, 2016 at 2:20 AM, Jaehyun Jang <span dir="ltr"><<a href="mailto:sysexits@gmail.com" target="_blank">sysexits@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div>Dear vtk users,<br><br></div>I am trying to these tasks using <i><b>vtkPolyDataMapper </b>with <b>vtkUnsignedCharArray</b></i>, <i><b>vtkRenderer</b>, <b>vtkRenderWindow </b></i>to get pixel count of a specific cell<br><i><br></i></div>1.
 Translate index value(within 1 ~ 16777215) to R, G, B value (using R = 
idx & 255, G = (idx >> 8) & 255, B = (idx >> 16) 
& 255<br></div>2. From all points of each cell, assigning those color values into <b>vtkUnsignedCharArray </b>with SetTupleValue(point index of same cell, color) (the forth value of color is always 255)<br></div><div>-
 i.e, All different cells have different RGB value. (If I set only 50 
cells in the model, only 50 cells have distinct color in 1 ~ 50)<br></div><div>3. Setting the model using <b>vtkProperty </b>with these settings<br>    m_actor->GetProperty()->Backfa<wbr>ceCullingOn();<br>    m_actor->GetProperty()->Lighti<wbr>ngOff();<br>    m_actor->GetProperty()->Shadin<wbr>gOff();<br>    m_actor->GetProperty()->SetInt<wbr>erpolationToFlat();<br><br></div>4. Render this model using <b>vtkRenderWindow </b>with these settings<br>    renderwindow->SetOffScreenRend<wbr>ering(1);<br>    renderwindow->AddRenderer(rend<wbr>erer);<br><div>    renderwindow->SetSize(600, 600);<br>    renderwindow->Render()<br></div><div>5. Get vtkImageData using <b>vtkWindowToImageFilter </b>and access GetScalarPointer<br></div><div>6. Translate RGB to index and count it.<br><br></div><div>However,
 RGB values translate wrong indices which I did not expect, I want to 
know how to set my renderer or actor without interpolation and shading 
to get the expected color.<br><br></div>Thanks.<span class="HOEnZb"><font color="#888888"><br clear="all"><br>-- <br><div class="m_-7237642440270312197gmail_signature"><div dir="ltr"><b style="font-family:"roboto condensed",tauri,"hiragino sans gb","microsoft yahei",stheiti,simsun,"lucida grande","lucida sans unicode","lucida sans","segoe ui",applesdgothicneo-medium,"malgun gothic",verdana,tahoma,sans-serif;font-size:15px;line-height:18px">Jaehyun Jang</b><br style="font-family:"roboto condensed",tauri,"hiragino sans gb","microsoft yahei",stheiti,simsun,"lucida grande","lucida sans unicode","lucida sans","segoe ui",applesdgothicneo-medium,"malgun gothic",verdana,tahoma,sans-serif;font-size:15px;line-height:18px;clear:both"><span style="font-family:"roboto condensed",tauri,"hiragino sans gb","microsoft yahei",stheiti,simsun,"lucida grande","lucida sans unicode","lucida sans","segoe ui",applesdgothicneo-medium,"malgun gothic",verdana,tahoma,sans-serif;font-size:15px;line-height:18px">Master's candidate</span><br style="font-family:"roboto condensed",tauri,"hiragino sans gb","microsoft yahei",stheiti,simsun,"lucida grande","lucida sans unicode","lucida sans","segoe ui",applesdgothicneo-medium,"malgun gothic",verdana,tahoma,sans-serif;font-size:15px;line-height:18px;clear:both"><span style="font-family:"roboto condensed",tauri,"hiragino sans gb","microsoft yahei",stheiti,simsun,"lucida grande","lucida sans unicode","lucida sans","segoe ui",applesdgothicneo-medium,"malgun gothic",verdana,tahoma,sans-serif;font-size:15px;line-height:18px">School of Computing, KAIST</span><br style="font-family:"roboto condensed",tauri,"hiragino sans gb","microsoft yahei",stheiti,simsun,"lucida grande","lucida sans unicode","lucida sans","segoe ui",applesdgothicneo-medium,"malgun gothic",verdana,tahoma,sans-serif;font-size:15px;line-height:18px;clear:both"><span style="font-family:"roboto condensed",tauri,"hiragino sans gb","microsoft yahei",stheiti,simsun,"lucida grande","lucida sans unicode","lucida sans","segoe ui",applesdgothicneo-medium,"malgun gothic",verdana,tahoma,sans-serif;font-size:15px;line-height:18px">291, Daehak-ro, Yuseong-gu, Daejeon</span><br style="font-family:"roboto condensed",tauri,"hiragino sans gb","microsoft yahei",stheiti,simsun,"lucida grande","lucida sans unicode","lucida sans","segoe ui",applesdgothicneo-medium,"malgun gothic",verdana,tahoma,sans-serif;font-size:15px;line-height:18px;clear:both"><span style="font-family:"roboto condensed",tauri,"hiragino sans gb","microsoft yahei",stheiti,simsun,"lucida grande","lucida sans unicode","lucida sans","segoe ui",applesdgothicneo-medium,"malgun gothic",verdana,tahoma,sans-serif;font-size:15px;line-height:18px">E3-1, 2413 STE</span><br style="font-family:"roboto condensed",tauri,"hiragino sans gb","microsoft yahei",stheiti,simsun,"lucida grande","lucida sans unicode","lucida sans","segoe ui",applesdgothicneo-medium,"malgun gothic",verdana,tahoma,sans-serif;font-size:15px;line-height:18px;clear:both"><a href="http://cgv.kaist.ac.kr/" style="font-family:"roboto condensed",tauri,"hiragino sans gb","microsoft yahei",stheiti,simsun,"lucida grande","lucida sans unicode","lucida sans","segoe ui",applesdgothicneo-medium,"malgun gothic",verdana,tahoma,sans-serif;font-size:15px;line-height:18px;text-decoration:none;vertical-align:baseline;color:rgb(50,105,160)" target="_blank">Computer Graphics and Visualization Lab</a><br style="font-family:"roboto condensed",tauri,"hiragino sans gb","microsoft yahei",stheiti,simsun,"lucida grande","lucida sans unicode","lucida sans","segoe ui",applesdgothicneo-medium,"malgun gothic",verdana,tahoma,sans-serif;font-size:15px;line-height:18px;clear:both"><a href="https://www.linkedin.com/in/silvesterjang" style="font-family:"roboto condensed",tauri,"hiragino sans gb","microsoft yahei",stheiti,simsun,"lucida grande","lucida sans unicode","lucida sans","segoe ui",applesdgothicneo-medium,"malgun gothic",verdana,tahoma,sans-serif;font-size:15px;line-height:18px;text-decoration:none;vertical-align:baseline;color:rgb(50,105,160)" target="_blank">Resume</a><span style="font-family:"roboto condensed",tauri,"hiragino sans gb","microsoft yahei",stheiti,simsun,"lucida grande","lucida sans unicode","lucida sans","segoe ui",applesdgothicneo-medium,"malgun gothic",verdana,tahoma,sans-serif;font-size:15px;line-height:18px"> | </span><a href="https://github.com/sysexits" style="font-family:"roboto condensed",tauri,"hiragino sans gb","microsoft yahei",stheiti,simsun,"lucida grande","lucida sans unicode","lucida sans","segoe ui",applesdgothicneo-medium,"malgun gothic",verdana,tahoma,sans-serif;font-size:15px;line-height:18px;text-decoration:none;vertical-align:baseline;color:rgb(50,105,160)" target="_blank">Github</a><span style="font-family:"roboto condensed",tauri,"hiragino sans gb","microsoft yahei",stheiti,simsun,"lucida grande","lucida sans unicode","lucida sans","segoe ui",applesdgothicneo-medium,"malgun gothic",verdana,tahoma,sans-serif;font-size:15px;line-height:18px"> | </span><a style="font-family:"roboto condensed",tauri,"hiragino sans gb","microsoft yahei",stheiti,simsun,"lucida grande","lucida sans unicode","lucida sans","segoe ui",applesdgothicneo-medium,"malgun gothic",verdana,tahoma,sans-serif;font-size:15px;line-height:18px;text-decoration:none;vertical-align:baseline;color:rgb(50,105,160)">Personal</a></div></div>
</font></span></div>
<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>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Ken Martin PhD<div>Chairman & CFO<br>Kitware Inc.<br>28 Corporate Drive<br>Clifton Park NY 12065<br>518 371 3971<div><br></div><div><span style="font-size:10pt;font-family:Tahoma,sans-serif">This communication,
including all attachments, contains confidential and legally privileged
information, and it is intended only for the use of the addressee.  Access to this email by anyone else is
unauthorized. If you are not the intended recipient, any disclosure, copying,
distribution or any action taken in reliance on it is prohibited and may be
unlawful. If you received this communication in error please notify us
immediately and destroy the original message. 
Thank you.</span></div></div></div>
</div>