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> vtkUnsignedCharArray *colorArray = vtkUnsignedCharArray::New();<br> colorArray->SetNumberOfComponents(3); <br> colorArray->InsertTuple3(0,100.0,0.0,0.0); <br> colorArray->InsertTuple3(1,100.0,0.0,0.0); <br> colorArray->InsertTuple3(2,100.0,0.0,0.0); <br> colorArray->InsertTuple3(3,100.0,0.0,0.0);<br><br> vtkImageData *image =
vtkImageData::New();<br> image->SetDimensions(2,2,1);<br> image->SetSpacing(1.0,1.0,1.0);<br> image->SetOrigin(0.0,0.0,0.0);<br> image->SetScalarType(VTK_UNSIGNED_CHAR);<br> image->GetPointData()->SetScalars(colorArray);<br> <br> vtkImageAppend *reader = vtkImageAppend::New();<br> reader->AddInput(image);<br><br> vtkDataSetMapper *mapper = vtkDataSetMapper::New();<br> mapper->SetInput(reader->GetOutput());<br> <br> vtkActor *actor = vtkActor::New();<br> actor->SetMapper(mapper); <br><br> vtkRenderer* ren =
vtkRenderer::New();<br> ren->AddActor(actor);<br> ren->SetBackground(1, 1, 1);<br><br> vtkRenderWindow* renWin = vtkRenderWindow::New();<br> renWin->AddRenderer(ren);<br><br> vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();<br> iren->SetRenderWindow(renWin);<br> vtkInteractorStyleTrackballCamera *style = vtkInteractorStyleTrackballCamera::New();<br> iren->SetInteractorStyle(style);<br> renWin->SetSize(600,600);<br> renWin->Render();<br> iren->Start();<br><br> style->Delete();<br> iren->Delete();<br> ren->Delete();<br> renWin->Delete();<br>
actor->Delete();<br> mapper->Delete();<br> reader->Delete();<br> return 0;<br><br>}<br><br><br><p> 
<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>