<div dir="ltr"><div>Don't forget that use of SetColor() often requires this:</div><div><br></div><div>  mapper.ScalarVisibilityOff()</div><div><br></div><div>SetColor() is ignored if scalars are present and visible.</div><div><br></div><div> - David</div><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 4, 2015 at 12:24 PM, 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"><div dir="ltr">In that case, you can leave out the vtkLookupTable altogether and set the color in your actor instead<div><br></div><div>actor = vtk.vtkActor()</div><div>actor.SetMapper(mapper)</div><div>property = actor.GetProperty()</div><div>property.SetColor(<span style="font-size:12.8000001907349px">*rgb_cluster_mapping[cluster_</span><span style="font-size:12.8000001907349px">ind])</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">HTH,</span></div><div><span style="font-size:12.8000001907349px">Cory</span></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 4, 2015 at 2:15 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">No, I'd like the entire mesh to be one color (and opacity).</div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 4, 2015 at 2:04 PM, 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"><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"><div><div>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></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><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>
</div></div></blockquote></div></div></blockquote></div></div></div></div></blockquote></div></div></div></div></blockquote></div><br></div></div>