[vtkusers] How to display image sequence automatically?
Fucang Jia
fcjia at ict.ac.cn
Sun May 26 23:30:23 EDT 2002
Dear all,
I encounter a question, I want to display many pieces of image using vtkImageData and vtkImageActor. But when I render them, only one image is displayed. How to display them automatically in a for cycle? Thanks a lot. Here is my code in OnDraw(CDC* pDC):
....
vtkRenderer *ren = vtkRenderer::New();
vtkRenderWindow *renWin = vtkRenderWindow::New();
renWin->AddRenderer(ren);
vtkImageData *ImageData = vtkImageData::New();
ImageData->SetScalarTypeToUnsignedChar();
ImageData->SetExtent(0,255,0,2550,0);
ImageData->AllocateScalars();
vtkImageActor *ImageActor = vtkImageActor::New();
int i,j,k;
for(i=0;i<72;i++){
for(j=0;j<256;j++)
for(k=0;k<256;k++)
ImageData->GetPointData()->GetScalars()->SetTuple1(j*256+k, image[i][j][k]);
ImageActor->SetInput(ImageData);
ren->AddActor(ImageActor);
renWin->Render();
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20020527/a7f23c45/attachment.htm>
More information about the vtkusers
mailing list