[vtkusers] HOW to read BMP files to create a volume?

Sentil Balaji profbalse at yahoo.co.in
Fri Jan 9 13:32:43 EST 2004


Hey,
   I mailed the same question using
vtkVolume16Reader.Now, I used vtkBMReader and I had
the following error:
------------------
Generic Warning: In D:\VTK\IO\vtkBMPReader.cxx, line
476
File operation failed. row = 0, Read = 126, Skip0 = 2,
Skip1 = 0, FilePos = 17206, FileName = C:/p.0.bmp
------------------------
This is the code:

void main()
{   
       vtkRenderWindow *w=vtkRenderWindow::New();
       vtkBMPReader *r=vtkBMPReader::New();
       vtkImageReader *ir=vtkImageReader::New();
       vtkRenderer *ren=vtkRenderer::New();
       vtkImageActor *a=vtkImageActor::New(); 
       vtkRenderWindowInteractor   
*i=vtkRenderWindowInteractor::New();
	   vtkVolume16Reader *v=vtkVolume16Reader::New();
           i->SetRenderWindow(w);
           r->SetFileDimensionality(3);
	   r->SetFilePrefix("C:/p");
	   r->SetFilePattern("%s.%d.bmp");
	   r->SetDataByteOrderToLittleEndian();
           r->SetDataSpacing(3.0,2.0,8.0);
	   a->SetInput(r->GetOutput());
	   w->AddRenderer(ren);
	   ren->AddActor(a);
	   w->Render();
	   i->Start(); 
}

I see a plane image with no rendering in the output
window.

Awaiting your reply...

Thanks

Cheers
BeeJay

________________________________________________________________________
Yahoo! India Mobile: Download the latest polyphonic ringtones.
Go to http://in.mobile.yahoo.com



More information about the vtkusers mailing list