[vtkusers] BMPReader --> Volume

Michnay Balázs michnay at freemail.hu
Tue Mar 29 10:32:55 EST 2005


Dear VTK Users,
I'm using a vtkBMPReader to read several images at once and to build 
a volume. The images are read because the Z-value is correct but only 
the first and the last slices can be seen. The whole volume looks like a 
black cube with the first image textured to the top and the last image 
textured to the bottom.
To understand what I'm saying please take a look at the following 
image which demonstrates the problem:

http://www.inf.u-szeged.hu/~michnay/volume.jpg

The extent of the slices are not the same but reading images with 
equal extents provided the same result.
What I'd like to do is to visualize all the slices in one volume (the middle 
ones as well) without the black cube...

---------------------------------
What my C++ code does:

vtkBMPReader *Reader = vtkBMPReader::New();
Reader->SetNumberOfScalarComponents(3);
Reader->SetFilePrefix("E:/kep/slice");

Reader->SetFilePattern("%s.%d");
Reader->SetFileNameSliceOffset(1);
Reader->SetFileNameSliceSpacing(1);		

Reader->SetDataSpacing(1.0,1.0,0.1);
Reader->SetDataOrigin(0,0,0);
Reader->Update();
		
vtkActor *VolumeActor = vtkActor::New();
vtkDataSetMapper *VolumeMapper = vtkDataSetMapper::New();

VolumeMapper->SetInput(Reader->GetOutput());
VolumeActor->SetMapper(VolumeMapper);

pDoc->renderer->AddActor(VolumeActor);
pDoc->camera->Zoom(0.1);
pDoc->renWin->Render();
-----------------------------------

What am I missing?
Thanks for your help in advance!
All the best,

  MB



More information about the vtkusers mailing list