Hi all,<br><br>I would like to color an isosurface with scalar field. When I associate my scalars to my data set before filtering, I have no problem. To reduce time processing, I want to associate  my scalars after filtering operation, but I only get grey 3D object on screen.<br>
<br><br>          //before filtering<br>          int nbPoints = (int)m_ImageData-&gt;GetPointData()-&gt;GetArray(0)-&gt;GetNumberOfTuples();<br>          <br>          vtkIntArray *colorArray = vtkIntArray::New();<br>          colorArray-&gt;SetName(&quot;colorArray&quot;);<br>
          //m_ProcessedImageData-&gt;SetScalarTypeToShort();<br>          colorArray-&gt;SetNumberOfValues(nbPoints);<br>          int *ptrColorArray = colorArray-&gt;GetPointer(0);<br>          for( int i = 0; i &lt; nbPoints i++){<br>
                ptrColorArray[i] = 1; // just to test<br>          }<br>          m_ImageData-&gt;GetPointData()-&gt;AddArray(colorArray);<br><br>[filtering]<br><br>    m_Reverser-&gt;Update();<br>    int nbPoints = (int)m_ReverseSenceFilter-&gt;GetOutput()-&gt;GetPointData()-&gt;GetArray(0)-&gt;GetNumberOfTuples();<br>
       <br>    vtkIntArray *colorArray2 = vtkIntArray::New();<br>    colorArray2-&gt;SetName(&quot;colorArray2&quot;);<br>    //m_ReverseSenceFilter-&gt;GetOutput()-&gt;SetScalarTypeToShort();<br>    colorArray2-&gt;SetNumberOfValues(nbPoints);<br>
    int *ptrColorArray2 = colorArray2-&gt;GetPointer(0);<br>    for(i = 0; i &lt; 100; i++)<br>      ptrColorArray2[i] = 2;<br>    for(i = 100; i &lt; nbPoints; i++)<br>
      ptrColorArray2[i] = 4;<br><br>    m_ReverseSenceFilter-&gt;GetOutput()-&gt;GetPointData()-&gt;AddArray(colorArray2);<br>    m_ReverseSenceFilter-&gt;GetOutput()-&gt;GetPointData()-&gt;SetActiveScalars(&quot;colorArray2&quot;);<br>
<br><br>    // render<br>    m_PolyDataMapper-&gt;ScalarVisibilityOn();<br>    <br>    m_PolyDataMapper-&gt;SetScalarRange(0,11);<br>    m_PolyDataMapper-&gt;SetScalarModeToUseCellFieldData();<br>    m_PolyDataMapper-&gt;SelectColorArray(&quot;colorArray2&quot;);  // my object is just grey<br>
    //m_PolyDataMapper-&gt;SelectColorArray(&quot;colorArray&quot;); // no problem if I uncomment this line<br><br><br>My colorArray2 scalars are well add to my ReverseSenseFilter. <br><br>Where is my mistake and any idea about how to overcome it?<br>
<br>Thanks,<br>Corinne<br><a href="mailto:corinne.tith@eisti.fr" target="_blank"></a>