<div dir="ltr"><div><span style="font-size:12.8000001907349px">Are you trying to color map a particular data array in the contour?</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 3, 2015 at 3:43 PM, Tudor Achim <span dir="ltr"><<a href="mailto:tachim@cs.stanford.edu" target="_blank">tachim@cs.stanford.edu</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>Hi all,<br></div>I have a quick question about coloring vtkPolyMappers. I have the following code:<br><br>for cluster_ind in ...:<br><div style="margin-left:40px">threshold = vtk.vtkImageThreshold()                         <br>threshold.SetInputConnection(importer.GetOutputPort())      <br>threshold.ThresholdBetween(cluster_ind-0.1, cluster_ind+0.1)<br>threshold.ReplaceInOn()                                     <br>threshold.SetInValue(0)  <br>threshold.ReplaceOutOn()                                    <br>threshold.SetOutValue(1)<br>threshold.Update()                                          <br>                                                            <br>dmc = vtk.vtkDiscreteMarchingCubes()                        <br>dmc.SetInputConnection(threshold.GetOutputPort())           <br>dmc.GenerateValues(1, 1, 1)                                 <br>dmc.Update()                                                <br>                                                            <br>mapper = vtk.vtkPolyDataMapper()                            <br>mapper.SetInputConnection(dmc.GetOutputPort())              <br>                                                            <br>lut = vtk.vtkLookupTable()                                  <br>lut.SetNumberOfTableValues(2)                               <br>lut.SetTableValue(0, 0, 0, 255)                             <br>lut.SetTableValue(1, *rgb_cluster_mapping[cluster_ind])     <br>lut.Build()                                                 <br>mapper.SetLookupTable(lut)                                  <br>mapper.SetScalarModeToUseCellData()                         <br></div><br></div>However, when I run it only one of the mappers is colored correctly; the other one is just rendered as black. I can tell that it's rendered black because when I spin around the clusters in my viewer I can see it obstructing the other clusters. The intended colors are (0, 255, 0) and (88, 86, 214) (that's what's in rgb_cluster_mapping for these clusters).<br><br></div>Any ideas?<br></div>
<br>_______________________________________________<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/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_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=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/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Cory Quammen<br>R&D Engineer<br>Kitware, Inc.</div>
</div>