<HTML><HEAD></HEAD>
<BODY dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt">
<DIV>Hi</DIV>
<DIV>&nbsp;</DIV>
<DIV>I think you’r graphic card doesnot have this extension supported. Do you 
have any GPU based card ? like ATI Radeon or Nvidia ?<BR></DIV>
<DIV>&nbsp;</DIV>
<DIV>Alex</DIV>
<DIV 
style="FONT-STYLE: normal; DISPLAY: inline; FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: small; FONT-WEIGHT: normal; TEXT-DECORATION: none">
<DIV style="FONT: 10pt tahoma">
<DIV>&nbsp;</DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A 
title=prathameshmkulkarni@gmail.com 
href="mailto:prathameshmkulkarni@gmail.com">Prathamesh Kulkarni</A> </DIV>
<DIV><B>Sent:</B> Wednesday, September 21, 2011 9:32 AM</DIV>
<DIV><B>To:</B> <A title=vtkusers@vtk.org href="mailto:vtkusers@vtk.org">VTK 
Mailing List</A> ; <A title=insight-users@itk.org 
href="mailto:insight-users@itk.org">insight-users@itk.org</A> </DIV>
<DIV><B>Cc:</B> <A title=jdluisi@central.uh.edu 
href="mailto:jdluisi@central.uh.edu">Luisi, Jonathan D</A> </DIV>
<DIV><B>Subject:</B> [Insight-users] problems with rendering using ray 
casting</DIV></DIV></DIV>
<DIV>&nbsp;</DIV></DIV>
<DIV 
style="FONT-STYLE: normal; DISPLAY: inline; FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: small; FONT-WEIGHT: normal; TEXT-DECORATION: none">
<DIV dir=ltr>
<DIV>&nbsp;</DIV>
<DIV>Hello, </DIV>
<DIV>&nbsp;</DIV>
<DIV>I am trying to render a volume (mhd file read as ITKImage&lt;float, 3&gt;) 
using VTK ray casting. I have tried to use the different available mappers, but 
the output is always only background. For the mappers using OpenGL, I get the 
error:&nbsp; line 100 vtkOpenGLVolumeTextureMapper3D (0000000003270440): 
required extensions not supported. Below is my code. Any help would be very 
useful.</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; typedef 
itk::ImageToVTKImageFilter&lt;ImageType3D&gt; ITKToVTKConnectorType;</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>ITKToVTKConnectorType::Pointer ITK_to_VTK_connector 
= ITKToVTKConnectorType::New();</DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>ITK_to_VTK_connector-&gt;SetInput(data_ptr);</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>ITK_to_VTK_connector-&gt;Update();</DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>vtkSmartPointer&lt;vtkImageData&gt; vtk_image = 
ITK_to_VTK_connector-&gt;GetOutput();</DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span></SPAN>// Testing vtk 
image</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>vtk_image-&gt;PrintSelf(std::cout, 
vtkIndent(0));</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span></SPAN>&nbsp;</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>vtkSmartPointer&lt;vtkRenderer&gt; renderer = 
vtkSmartPointer&lt;vtkRenderer&gt;::New();</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>renderer-&gt;SetBackground(1.0, 1.0, 1.0);</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span></SPAN></DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
vtkSmartPointer&lt;vtkRenderWindow&gt; render_window = 
vtkSmartPointer&lt;vtkRenderWindow&gt;::New();</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>render_window-&gt;AddRenderer(renderer);</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span></SPAN></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>vtkSmartPointer&lt;vtkRenderWindowInteractor&gt; 
render_window_interactor = 
vtkSmartPointer&lt;vtkRenderWindowInteractor&gt;::New();</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>render_window_interactor-&gt;SetRenderWindow(render_window);</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span></SPAN></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>vtkSmartPointer&lt;vtkPiecewiseFunction&gt; 
opacity_transfer_function = 
vtkSmartPointer&lt;vtkPiecewiseFunction&gt;::New();</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>/*opacity_transfer_function-&gt;AddPoint(20, 
0.0);</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>opacity_transfer_function-&gt;AddPoint(25, 
0.2);</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span></SPAN>*/</DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>vtkSmartPointer&lt;vtkColorTransferFunction&gt; 
color_transfer_function = 
vtkSmartPointer&lt;vtkColorTransferFunction&gt;::New();</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>/*color_transfer_function-&gt;AddRGBPoint(0.0, 0.0, 
0.0, 0.0);</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>color_transfer_function-&gt;AddRGBPoint(64.0, 1.0, 
0.0, 0.0);</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>color_transfer_function-&gt;AddRGBPoint(128.0, 0.0, 
0.0, 1.0);</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>color_transfer_function-&gt;AddRGBPoint(192.0, 0.0, 
1.0, 0.0);</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>color_transfer_function-&gt;AddRGBPoint(255.0, 0.0, 
0.2, 0.0);</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span></SPAN>*/</DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>vtkSmartPointer&lt;vtkVolumeProperty&gt; 
volume_property = vtkSmartPointer&lt;vtkVolumeProperty&gt;::New();</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>volume_property-&gt;SetColor(color_transfer_function);</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>volume_property-&gt;SetScalarOpacity(opacity_transfer_function);</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>volume_property-&gt;ShadeOn();</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>volume_property-&gt;SetInterpolationTypeToLinear();</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>volume_property-&gt;SetIndependentComponents(1);</DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>vtkSmartPointer&lt;vtkVolumeRayCastCompositeFunction&gt; 
composite_function = 
vtkSmartPointer&lt;vtkVolumeRayCastCompositeFunction&gt;::New();</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span></SPAN></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>//vtkSmartPointer&lt;vtkVolumeRayCastMapper&gt; 
volume_mapper = vtkSmartPointer&lt;vtkVolumeRayCastMapper&gt;::New();</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>//vtkSmartPointer&lt;vtkFixedPointVolumeRayCastMapper&gt; 
volume_mapper = 
vtkSmartPointer&lt;vtkFixedPointVolumeRayCastMapper&gt;::New();</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span></SPAN></DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
vtkSmartPointer&lt;vtkOpenGLVolumeTextureMapper3D&gt; volume_mapper = 
vtkSmartPointer&lt;vtkOpenGLVolumeTextureMapper3D&gt;::New();</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>//vtkSmartPointer&lt;vtkGPUVolumeRayCastMapper&gt; 
volume_mapper = vtkSmartPointer&lt;vtkGPUVolumeRayCastMapper&gt;::New();</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>//vtkSmartPointer&lt;vtkOpenGLGPUVolumeRayCastMapper&gt; 
volume_mapper = 
vtkSmartPointer&lt;vtkOpenGLGPUVolumeRayCastMapper&gt;::New();</DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>//volume_mapper-&gt;SetVolumeRayCastFunction(composite_function);</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>volume_mapper-&gt;SetInput(vtk_image);</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>volume_mapper-&gt;SetBlendModeToComposite();</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>//volume_mapper-&gt;SetBlendModeToMaximumIntensity();</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>//volume_mapper-&gt;SetScalarMode(1);</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>volume_mapper-&gt;SetSampleDistance(0.2);</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span></SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>vtkSmartPointer&lt;vtkVolume&gt; volume = 
vtkSmartPointer&lt;vtkVolume&gt;::New();</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>volume-&gt;SetMapper(volume_mapper);</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>volume-&gt;SetProperty(volume_property);</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>volume-&gt;Update();</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span></SPAN></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>render_window-&gt;Render();</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>renderer-&gt;AddVolume(volume);</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>renderer-&gt;ResetCamera();</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span></SPAN></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>render_window_interactor-&gt;Initialize();</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>render_window-&gt;Render();</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>render_window_interactor-&gt;Start();</DIV></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks,</DIV>
<DIV>Prathamesh</DIV></DIV>
<P>
<HR>
_____________________________________<BR>Powered by www.kitware.com<BR><BR>Visit 
other Kitware open-source projects 
at<BR>http://www.kitware.com/opensource/opensource.html<BR><BR>Kitware offers 
ITK Training Courses, for more information 
visit:<BR>http://www.kitware.com/products/protraining.html<BR><BR>Please keep 
messages on-topic and check the ITK FAQ 
at:<BR>http://www.itk.org/Wiki/ITK_FAQ<BR><BR>Follow this link to 
subscribe/unsubscribe:<BR>http://www.itk.org/mailman/listinfo/insight-users<BR></DIV></DIV></DIV></BODY></HTML>