[vtkusers] reading a stack of bmp files

Veerapuram Varadhan v.varadhan at californiadigital.com
Mon Apr 5 09:52:15 EDT 2004


Hi,

You can use vtkBMPReader.

For example,

vtkBMPReader* bmpData = vtkBMPReader::New();
bmpData->SetFilePrefix ("foo.bmp"); // base file prefix for a series
bmpData->SetFilePattern ("%s.%d"); // pattern of the series would be
                                   // foo.bmp.1, foo.bmp.2, ....
bmpData->SetDataExtent (xmin, xmax, ymin, ymax, zmin, zmax);
bmpData->Update();

vtkRenderer* ren = vtkRenderer::New();
vtkRenderWindow* renwin = vtkRenderWindow::New();
renwin->AddRenderer (ren);

vtkActor* actor = vtkActor::New();
actor->SetInput (bmpData->GetOutput());
ren->AddActor (actor);
renwin->Render();

HTH,

V. Varadhan.



> Dear frens'
>
> I have a series of bmp files say foo1.bmp, foo2.bmp......etc. I want to
> read in these files and stack them to generate a 3D image.
> Plz suggest.
>
> thanks for any help.
>
> Megha
>
> Win an evening with the Indian cricket captain: Yahoo! India Promos.




More information about the vtkusers mailing list