<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=text/html;charset=iso-8859-1 http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.7600.16490"></HEAD>
<BODY style="PADDING-LEFT: 10px; PADDING-RIGHT: 10px; PADDING-TOP: 15px"
id=MailContainerBody leftMargin=0 topMargin=0 CanvasTabStop="true"
name="Compose message area">
<DIV><FONT face=Calibri>hi there,</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>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). </FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Calibri>System config:</FONT></DIV>
<DIV><FONT face=Calibri>Intel Pentium Dual CPU T3200</FONT></DIV>
<DIV><FONT face=Calibri>4GB RAM</FONT></DIV>
<DIV><FONT face=Calibri>NVIDIA GeForece 9300GS 256 MB</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Calibri>C# Code:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT
face=Calibri>
vtkRenderer renderer1 = new
vtkRenderer();<BR>
vtkRenderWindow renWin1 = new
vtkRenderWindow();<BR>
vtkOpenGLExtensionManager extensions = new
vtkOpenGLExtensionManager();<BR>
extensions.SetRenderWindow(renWin1);<BR>
extensions.Update();<BR>
extensions.LoadExtension("GL_VERSION_2_0");<BR>
extensions.Dispose();<BR>
<BR>
renWin1.AddRenderer(renderer1);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT
face=Calibri>
vtkRenderWindowInteractor iren1 = new
vtkRenderWindowInteractor();<BR>
iren1.SetRenderWindow(renWin1);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT
face=Calibri>
vtkJPEGReader reader = new
vtkJPEGReader();<BR>
reader.SetFilePattern("C:\\Teste\\Crop\\%d.jpg");</FONT></DIV>
<DIV> </DIV>
<DIV><FONT
face=Calibri>
reader.SetDataExtent(0, 511, 0, 427, 0,
72);<BR>
reader.SetDataSpacing(10.7, 8, 20); //
mm<BR>
reader.SetDataOrigin(0, 0,
0);<BR>
//reader.SetNumberOfScalarComponents(1);<BR>
reader.SetDataScalarTypeToUnsignedChar();<BR>
reader.Update();</FONT></DIV>
<DIV> </DIV><FONT face=Calibri>
<DIV><BR>
vtkPiecewiseFunction opacityTransferFunction = new
vtkPiecewiseFunction();<BR>
opacityTransferFunction.AddPoint(180,
0.0);<BR>
opacityTransferFunction.AddPoint(0, 1);</DIV>
<DIV> </DIV>
<DIV>
vtkVolumeProperty volumeProperty = new
vtkVolumeProperty();<BR>
volumeProperty.SetScalarOpacity(opacityTransferFunction);<BR>
volumeProperty.SetInterpolationTypeToNearest();<BR>
//volumeProperty.ShadeOn();</DIV>
<DIV> </DIV>
<DIV>
vtkVolumeTextureMapper2D textureMapper = new
vtkVolumeTextureMapper2D();<BR>
textureMapper.SetInputConnection(reader.GetOutputPort());<BR> <BR>
//vtkFixedPointVolumeRayCastMapper volumeMapper = new
vtkFixedPointVolumeRayCastMapper();<BR>
//volumeMapper.SetInputConnection(reader.GetOutputPort());</DIV>
<DIV> </DIV>
<DIV>
vtkVolume volume = new
vtkVolume();<BR>
volume.SetMapper(textureMapper);<BR>
volume.SetProperty(volumeProperty);<BR>
renderer1.AddVolume(volume);<BR>
renderer1.ResetCamera();</DIV>
<DIV> </DIV>
<DIV>
renWin1.Render();</DIV>
<DIV> </DIV>
<DIV>
iren1.Initialize();</DIV>
<DIV> </DIV>
<DIV>Regards,</DIV>
<DIV> </DIV>
<DIV>Pedro</FONT> </DIV></BODY></HTML>