[vtkusers] PROBLEM WITH VOLUME RENDERING...
Lisa Avila
lisa.avila at kitware.com
Sun Jan 11 22:59:54 EST 2004
Hello,
You are using a vtkImageActor which renders just one image from the series.
You will need to use a vtkVolume with some subclass of vtkVolumeMapper in
order to render a volume. You might want to look in the Examples directory
under VolumeRendering for some examples of how to do this.
Lisa
At 10:37 PM 1/11/2004, Sentil Balaji wrote:
>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
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at:
><http://public.kitware.com/cgi-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers
More information about the vtkusers
mailing list