[vtkusers] volume rendering help

Pedro Sá peternomak at hotmail.com
Fri Feb 5 11:42:18 EST 2010


hi again,thanks for your response. I was really hoping to mantain the wrapper as the entire solution is .NET based. I don't need extremely fast rendering, but for what i've read, the vtkTextureMapper2D could offer me reasonable results. Does the slow rendering might be  happening due to the number of images? I'm sure i'm doing something wrong but my VTK knowledge is just too little. Any ideas on why the vtkTextureMapper2D only renders sometimes a black cube, sometimes nothing?I am also using windows7 32bit.Regards
> Date: Fri, 5 Feb 2010 14:08:24 -0200
> Subject: Re: [vtkusers] volume rendering help
> From: wsales at gmail.com
> To: peternomak at hotmail.com
> CC: vtkusers at vtk.org
> 
> Hi Pedro,
> 
> If you wants a real GPU accelerated mapper, go to www.vtkedge.org and
> download VTKEdge. After compiling  with examples enabled, you can run
> the example GPURenderDemo against your series and see the results. The
> code are simple and you can use them to base your own.
> 
> Regards,
> 
> Wagner Sales
> 
> 2010/2/5 Pedro Sá <peternomak at hotmail.com>:
> > hi there,
> >
> > i'm having some issues with volume rendering. my goal is to display a 3d
> > model of 240 OCT slices with 511x427px. I've managed to create the 3d model
> > using the vtkFixedPointVolumeRayCastMapper but the performance is just too
> > slow. I read that this could be solved using the vtkVolumeTextureMapper2D
> > that, if I understood correctly, would use GPU acceleration. Unfortunately,
> > this renders nothing, only a black screen. Since i'm out of ideas I hope
> > that someone could help me in this. I'm using the VTK .NET wrapper (hoping
> > this is not whats causing the issue).
> >
> > System config:
> > Intel Pentium Dual CPU T3200
> > 4GB RAM
> > NVIDIA GeForece 9300GS 256 MB
> >
> > C# Code:
> >
> >             vtkRenderer renderer1 = new vtkRenderer();
> >             vtkRenderWindow renWin1 = new vtkRenderWindow();
> >             vtkOpenGLExtensionManager extensions = new
> > vtkOpenGLExtensionManager();
> >             extensions.SetRenderWindow(renWin1);
> >             extensions.Update();
> >             extensions.LoadExtension("GL_VERSION_2_0");
> >             extensions.Dispose();
> >
> >             renWin1.AddRenderer(renderer1);
> >
> >             vtkRenderWindowInteractor iren1 = new
> > vtkRenderWindowInteractor();
> >             iren1.SetRenderWindow(renWin1);
> >
> >             vtkJPEGReader reader = new vtkJPEGReader();
> >             reader.SetFilePattern("C:\\Teste\\Crop\\%d.jpg");
> >
> >             reader.SetDataExtent(0, 511, 0, 427, 0, 72);
> >             reader.SetDataSpacing(10.7, 8, 20); // mm
> >             reader.SetDataOrigin(0, 0, 0);
> >             //reader.SetNumberOfScalarComponents(1);
> >             reader.SetDataScalarTypeToUnsignedChar();
> >             reader.Update();
> >
> >             vtkPiecewiseFunction opacityTransferFunction = new
> > vtkPiecewiseFunction();
> >             opacityTransferFunction.AddPoint(180, 0.0);
> >             opacityTransferFunction.AddPoint(0, 1);
> >
> >             vtkVolumeProperty volumeProperty = new vtkVolumeProperty();
> >             volumeProperty.SetScalarOpacity(opacityTransferFunction);
> >             volumeProperty.SetInterpolationTypeToNearest();
> >             //volumeProperty.ShadeOn();
> >
> >             vtkVolumeTextureMapper2D textureMapper = new
> > vtkVolumeTextureMapper2D();
> >             textureMapper.SetInputConnection(reader.GetOutputPort());
> >
> >             //vtkFixedPointVolumeRayCastMapper volumeMapper = new
> > vtkFixedPointVolumeRayCastMapper();
> >             //volumeMapper.SetInputConnection(reader.GetOutputPort());
> >
> >             vtkVolume volume = new vtkVolume();
> >             volume.SetMapper(textureMapper);
> >             volume.SetProperty(volumeProperty);
> >             renderer1.AddVolume(volume);
> >             renderer1.ResetCamera();
> >
> >             renWin1.Render();
> >
> >             iren1.Initialize();
> >
> > Regards,
> >
> > Pedro
> >
> > _______________________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> >
> > Please keep messages on-topic and check the VTK FAQ at:
> > http://www.vtk.org/Wiki/VTK_FAQ
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtkusers
> >
> >
 		 	   		  
_________________________________________________________________
Quer 25GB de armazenamento gratuito na Internet? Conheça agora o SkyDrive.
http://www.eutenhomaisnowindowslive.com.br/?utm_source=MSN_Hotmail&utm_medium=Tagline&utm_campaign=InfuseSocial
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100205/96e4a4d7/attachment.htm>


More information about the vtkusers mailing list