[vtkusers] Volume Rendering help
Sean McInerney
seanm at nmr.mgh.harvard.edu
Fri Jul 9 01:06:28 EDT 2004
Hi Sentil,
First off, know that you will never see your Volume 'vol' rendered
unless you add it to your Renderer 'ren' ;-)
(i.e. ren->AddProp(vol);)
Next, if you will be simultaneously displaying the isosurface of the
cylinder data ('act'), you will need to call
IntermixIntersectingGeometryOn from your VolumeRayCastMapper 'rmap'.
(i.e. rmap->IntermixIntersectingGeometryOn();)
You may still have to adjust your color and opacity transfer
functions to achieve your expected results. Check out the
vtkVolumeRayCastMapper Examples and Tests for guidance.
-Sean
Sentil Balaji wrote:
> Hey,
>
> I am trying to render a cylinder from its circular
> section planes stored as .bmp files.When I render it I
> get a hollow cylinder instead of a solid one.I have
> the code below ,does it ring a bell in anyones' smart
> brain.If so, please help me out...Many Thanks....
> **********************CODE******************************
> #include<VTK4.4/vtkBMPReader.h>
> #include<VTK4.4/vtkRenderWindow.h>
> #include<VTK4.4/vtkRenderer.h>
> #include<VTK4.4/vtkRenderWindowInteractor.h>
> #include<VTK4.4/vtkPolyDataNormals.h>
> #include<VTK4.4/vtkContourFilter.h>
> #include<VTK4.4/vtkPolyDataMapper.H>
> #include<VTK4.4/vtkActor.H>
> #include<VTK4.4/vtkPolyData.h>
> #include<VTK4.4/vtkImageData.h>
> #include<VTK4.4/vtkOutlineFilter.h>
> #include<VTK4.4/vtkVolumeRayCastMapper.h>
> #include<VTK4.4/vtkVolumeRayCastCompositeFunction.h>
> #include<VTK4.4/vtkVolume.h>
> #include<VTK4.4/vtkDelaunay3D.h>
> #include<VTK4.4/vtkDataSetMapper.h>
>
> void main()
> {
> vtkBMPReader *br=vtkBMPReader::New();
> vtkRenderWindow *win=vtkRenderWindow::New();
> vtkRenderer *ren=vtkRenderer::New();
> vtkRenderWindowInteractor
> *it=vtkRenderWindowInteractor::New();
> vtkPolyDataNormals *pnorm=vtkPolyDataNormals::New();
> vtkPolyDataMapper *pmap=vtkPolyDataMapper::New();
> vtkContourFilter *cfilter=vtkContourFilter::New();
> vtkOutlineFilter *ofilter=vtkOutlineFilter::New();
> vtkVolumeRayCastMapper
> *rmap=vtkVolumeRayCastMapper::New();
> vtkVolumeRayCastCompositeFunction
> *rcomp=vtkVolumeRayCastCompositeFunction::New();
> vtkVolume *vol=vtkVolume::New();
> vtkActor *act=vtkActor::New();
> vtkDelaunay3D *del=vtkDelaunay3D::New();
> vtkDataSetMapper *dsm=vtkDataSetMapper::New();
> win->AddRenderer(ren);
> it->SetRenderWindow(win);
> br->SetDataExtent(1,256,1,256,1,50);
> br->SetFilePrefix("D:/DATA/d");
> br->SetFilePattern("%s%d.bmp");
> cfilter->SetInput(br->GetOutput());
> cfilter->SetValue(255,255);
> pnorm->SetInput(cfilter->GetOutput());
> pnorm->SetFeatureAngle(5.0);
> dsm->SetInput((vtkDataSet*)br->GetOutput());
> pmap->SetInput(cfilter->GetOutput());
> act->SetMapper(pmap);
> ren->AddActor(act);
> win->Render();
> it->Start();
> }
> *******************************************************
>
> ________________________________________________________________________
> Yahoo! India Careers: Over 50,000 jobs online
> Go to: http://yahoo.naukri.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