[vtkusers] PROBLEM WITH VOLUME RENDERING...

Sentil Balaji profbalse at yahoo.co.in
Sun Jan 11 22:37:07 EST 2004


Hey,
   
    I am trying to RENDER  a volume using section
images...I tried the vtkvolume16Reader , but it aint
producing a volume i.e It is not rendering the
required shape that would be obtained from the
sections.MArtin Gardner suggested using a IMAGE READER
with dimensionality 3...I tried that but it did not
work either...I have the code below...What should I
include to obtain the volume rendering....The
documentation states that the beginning and ending of
the files should be specified for the Reader , but
SetImageRange() is not a method of the any ImageReader
except the vtkVolume16Reader... I am a NOVICE...Please
help me render the volume ....MANY MANY THANKS

-----------------------------------------------------
#include<VTK\vtkRenderWindow.H>
#include<VTK\vtkBMPReader.H>
#include<iostream.h>
#include<VTK\vtkRenderer.H>
#include<VTK\vtkImageViewer2.H>
#include<VTK\vtkImageReader.H>
#include<VTK\vtkActor.H>
#include<VTK\vtkImageMapper.H>
#include<VTK\vtkImageActor.H>
#include<VTK\vtkRenderWindowInteractor.H>
#include<VTK\vtkBoxWidget.H>
#include<VTK\vtkVolume16Reader.H>
#include<VTK\vtkDataSetMapper.H>
void main()
{   
       vtkRenderWindow *w=vtkRenderWindow::New();
       vtkBMPReader *r=vtkBMPReader::New();
	   vtkRenderer *ren=vtkRenderer::New();
       vtkImageActor *a=vtkImageActor::New(); 
	   vtkRenderWindowInteractor
*i=vtkRenderWindowInteractor::New();
	   vtkVolume16Reader *v=vtkVolume16Reader::New();
	   vtkDataSetMapper *m=vtkDataSetMapper::New();
       i->SetRenderWindow(w);
       r->SetFileDimensionality(2);
       r->SetDataByteOrderToLittleEndian();
	   r->SetFilePrefix("C:\\P\\s");
	   r->SetFilePattern("%s.%d.bmp");
	   r->SetDataSpacing(3.0,2.0,3.0);
	   a->SetInput(r->GetOutput());
	   w->AddRenderer(ren);
	   ren->AddActor(a);
	   w->Render();
	   i->Start(); 
}
 -------------------------------------------------

=====
M.S[Electrical Engineering Graduate Student],
Research Associate,
Biomedical Optics and Imaging,
KINARD LABORATORY,
CLEMSON UNIVERISTY,
CLEMSON SC 29634,USA.

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



More information about the vtkusers mailing list