I added a colored image to vtkImageAppend, which produced an image without color.<br>The color array in its output also contains different values from that in original image:(100, 0, 0)(0,0,0)(100,0,0)(0,0,0)<br><br>Do you know what I did wrong? thank you very much. below is my code:<br><br>int main( int argc, char *argv[] )<br>{<br>&nbsp;&nbsp;&nbsp; vtkUnsignedCharArray *colorArray = vtkUnsignedCharArray::New();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; colorArray-&gt;SetNumberOfComponents(3);&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; colorArray-&gt;InsertTuple3(0,100.0,0.0,0.0);&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; colorArray-&gt;InsertTuple3(1,100.0,0.0,0.0);&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; colorArray-&gt;InsertTuple3(2,100.0,0.0,0.0);&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; colorArray-&gt;InsertTuple3(3,100.0,0.0,0.0);<br><br>&nbsp;&nbsp;&nbsp; vtkImageData *image =
 vtkImageData::New();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; image-&gt;SetDimensions(2,2,1);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; image-&gt;SetSpacing(1.0,1.0,1.0);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; image-&gt;SetOrigin(0.0,0.0,0.0);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; image-&gt;SetScalarType(VTK_UNSIGNED_CHAR);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; image-&gt;GetPointData()-&gt;SetScalars(colorArray);<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; vtkImageAppend *reader = vtkImageAppend::New();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; reader-&gt;AddInput(image);<br><br>&nbsp;&nbsp;&nbsp; vtkDataSetMapper *mapper = vtkDataSetMapper::New();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; mapper-&gt;SetInput(reader-&gt;GetOutput());<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; vtkActor *actor = vtkActor::New();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; actor-&gt;SetMapper(mapper);&nbsp;&nbsp;&nbsp; <br><br>&nbsp;&nbsp;&nbsp; vtkRenderer* ren =
 vtkRenderer::New();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ren-&gt;AddActor(actor);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ren-&gt;SetBackground(1, 1, 1);<br><br>&nbsp;&nbsp;&nbsp; vtkRenderWindow* renWin = vtkRenderWindow::New();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; renWin-&gt;AddRenderer(ren);<br><br>&nbsp;&nbsp;&nbsp; vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; iren-&gt;SetRenderWindow(renWin);<br>&nbsp;&nbsp;&nbsp; vtkInteractorStyleTrackballCamera *style = vtkInteractorStyleTrackballCamera::New();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; iren-&gt;SetInteractorStyle(style);<br>&nbsp;&nbsp;&nbsp; renWin-&gt;SetSize(600,600);<br>&nbsp;&nbsp;&nbsp; renWin-&gt;Render();<br>&nbsp;&nbsp;&nbsp; iren-&gt;Start();<br><br>&nbsp;&nbsp;&nbsp; style-&gt;Delete();<br>&nbsp;&nbsp;&nbsp; iren-&gt;Delete();<br>&nbsp;&nbsp;&nbsp; ren-&gt;Delete();<br>&nbsp;&nbsp;&nbsp; renWin-&gt;Delete();<br>&nbsp;&nbsp;&nbsp;
 actor-&gt;Delete();<br>&nbsp;&nbsp;&nbsp; mapper-&gt;Delete();<br>&nbsp;&nbsp;&nbsp; reader-&gt;Delete();<br>&nbsp;&nbsp;&nbsp; return 0;<br><br>}<br><br><br><p>&#32;
      <hr size=1>Looking for last minute shopping deals? <a href="http://us.rd.yahoo.com/evt=51734/*http://tools.search.yahoo.com/newsearch/category.php?category=shopping"> 
Find them fast with Yahoo! Search.</a>