<div dir="ltr">I am using Nvidia 6000 Quadro card which supposedly has support for OpenGL.<div><br></div><div>Prathamesh<br><br><div class="gmail_quote">On Wed, Sep 21, 2011 at 12:38 AM, alex Dowson <span dir="ltr"><<a href="mailto:alexdowson@hotmail.com">alexdowson@hotmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div dir="ltr">
<div dir="ltr">
<div style="font-family:'Calibri';color:#000000;font-size:12pt">
<div>Hi</div>
<div> </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> </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> </div>
<div style="background:#f5f5f5">
<div><b>From:</b> <a title="prathameshmkulkarni@gmail.com" href="mailto:prathameshmkulkarni@gmail.com" target="_blank">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" target="_blank">VTK
Mailing List</a> ; <a title="insight-users@itk.org" href="mailto:insight-users@itk.org" target="_blank">insight-users@itk.org</a> </div>
<div><b>Cc:</b> <a title="jdluisi@central.uh.edu" href="mailto:jdluisi@central.uh.edu" target="_blank">Luisi, Jonathan D</a> </div>
<div><b>Subject:</b> [Insight-users] problems with rendering using ray
casting</div></div></div>
<div> </div></div>
<div style="font-style:normal;display:inline;font-family:'Calibri';color:#000000;font-size:small;font-weight:normal;text-decoration:none"><div><div></div><div class="h5">
<div dir="ltr">
<div> </div>
<div>Hello, </div>
<div> </div>
<div>I am trying to render a volume (mhd file read as ITKImage<float, 3>)
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: line 100 vtkOpenGLVolumeTextureMapper3D (0000000003270440):
required extensions not supported. Below is my code. Any help would be very
useful.</div>
<div> </div>
<div> </div>
<div>
<div> typedef
itk::ImageToVTKImageFilter<ImageType3D> ITKToVTKConnectorType;</div>
<div><span style="white-space:pre-wrap"></span>ITKToVTKConnectorType::Pointer ITK_to_VTK_connector
= ITKToVTKConnectorType::New();</div>
<div> </div>
<div><span style="white-space:pre-wrap"></span>ITK_to_VTK_connector->SetInput(data_ptr);</div>
<div><span style="white-space:pre-wrap"></span>ITK_to_VTK_connector->Update();</div>
<div> </div>
<div><span style="white-space:pre-wrap"></span>vtkSmartPointer<vtkImageData> vtk_image =
ITK_to_VTK_connector->GetOutput();</div>
<div> </div>
<div><span style="white-space:pre-wrap"></span>// Testing vtk
image</div>
<div><span style="white-space:pre-wrap"></span>vtk_image->PrintSelf(std::cout,
vtkIndent(0));</div>
<div><span style="white-space:pre-wrap"></span> </div>
<div><span style="white-space:pre-wrap"></span>vtkSmartPointer<vtkRenderer> renderer =
vtkSmartPointer<vtkRenderer>::New();</div>
<div><span style="white-space:pre-wrap"></span>renderer->SetBackground(1.0, 1.0, 1.0);</div>
<div><span style="white-space:pre-wrap"></span></div>
<div>
vtkSmartPointer<vtkRenderWindow> render_window =
vtkSmartPointer<vtkRenderWindow>::New();</div>
<div><span style="white-space:pre-wrap"></span>render_window->AddRenderer(renderer);</div>
<div><span style="white-space:pre-wrap"></span></div>
<div><span style="white-space:pre-wrap"></span>vtkSmartPointer<vtkRenderWindowInteractor>
render_window_interactor =
vtkSmartPointer<vtkRenderWindowInteractor>::New();</div>
<div><span style="white-space:pre-wrap"></span>render_window_interactor->SetRenderWindow(render_window);</div>
<div><span style="white-space:pre-wrap"></span></div>
<div><span style="white-space:pre-wrap"></span>vtkSmartPointer<vtkPiecewiseFunction>
opacity_transfer_function =
vtkSmartPointer<vtkPiecewiseFunction>::New();</div>
<div><span style="white-space:pre-wrap"></span>/*opacity_transfer_function->AddPoint(20,
0.0);</div>
<div><span style="white-space:pre-wrap"></span>opacity_transfer_function->AddPoint(25,
0.2);</div>
<div><span style="white-space:pre-wrap"></span>*/</div>
<div> </div>
<div><span style="white-space:pre-wrap"></span>vtkSmartPointer<vtkColorTransferFunction>
color_transfer_function =
vtkSmartPointer<vtkColorTransferFunction>::New();</div>
<div><span style="white-space:pre-wrap"></span>/*color_transfer_function->AddRGBPoint(0.0, 0.0,
0.0, 0.0);</div>
<div><span style="white-space:pre-wrap"></span>color_transfer_function->AddRGBPoint(64.0, 1.0,
0.0, 0.0);</div>
<div><span style="white-space:pre-wrap"></span>color_transfer_function->AddRGBPoint(128.0, 0.0,
0.0, 1.0);</div>
<div><span style="white-space:pre-wrap"></span>color_transfer_function->AddRGBPoint(192.0, 0.0,
1.0, 0.0);</div>
<div><span style="white-space:pre-wrap"></span>color_transfer_function->AddRGBPoint(255.0, 0.0,
0.2, 0.0);</div>
<div><span style="white-space:pre-wrap"></span>*/</div>
<div> </div>
<div><span style="white-space:pre-wrap"></span>vtkSmartPointer<vtkVolumeProperty>
volume_property = vtkSmartPointer<vtkVolumeProperty>::New();</div>
<div><span style="white-space:pre-wrap"></span>volume_property->SetColor(color_transfer_function);</div>
<div><span style="white-space:pre-wrap"></span>volume_property->SetScalarOpacity(opacity_transfer_function);</div>
<div><span style="white-space:pre-wrap"></span>volume_property->ShadeOn();</div>
<div><span style="white-space:pre-wrap"></span>volume_property->SetInterpolationTypeToLinear();</div>
<div><span style="white-space:pre-wrap"></span>volume_property->SetIndependentComponents(1);</div>
<div> </div>
<div><span style="white-space:pre-wrap"></span>vtkSmartPointer<vtkVolumeRayCastCompositeFunction>
composite_function =
vtkSmartPointer<vtkVolumeRayCastCompositeFunction>::New();</div>
<div><span style="white-space:pre-wrap"></span></div>
<div><span style="white-space:pre-wrap"></span>//vtkSmartPointer<vtkVolumeRayCastMapper>
volume_mapper = vtkSmartPointer<vtkVolumeRayCastMapper>::New();</div>
<div><span style="white-space:pre-wrap"></span>//vtkSmartPointer<vtkFixedPointVolumeRayCastMapper>
volume_mapper =
vtkSmartPointer<vtkFixedPointVolumeRayCastMapper>::New();</div>
<div><span style="white-space:pre-wrap"></span></div>
<div>
vtkSmartPointer<vtkOpenGLVolumeTextureMapper3D> volume_mapper =
vtkSmartPointer<vtkOpenGLVolumeTextureMapper3D>::New();</div>
<div><span style="white-space:pre-wrap"></span>//vtkSmartPointer<vtkGPUVolumeRayCastMapper>
volume_mapper = vtkSmartPointer<vtkGPUVolumeRayCastMapper>::New();</div>
<div><span style="white-space:pre-wrap"></span>//vtkSmartPointer<vtkOpenGLGPUVolumeRayCastMapper>
volume_mapper =
vtkSmartPointer<vtkOpenGLGPUVolumeRayCastMapper>::New();</div>
<div> </div>
<div><span style="white-space:pre-wrap"></span>//volume_mapper->SetVolumeRayCastFunction(composite_function);</div>
<div><span style="white-space:pre-wrap"></span>volume_mapper->SetInput(vtk_image);</div>
<div><span style="white-space:pre-wrap"></span>volume_mapper->SetBlendModeToComposite();</div>
<div><span style="white-space:pre-wrap"></span>//volume_mapper->SetBlendModeToMaximumIntensity();</div>
<div><span style="white-space:pre-wrap"></span>//volume_mapper->SetScalarMode(1);</div>
<div><span style="white-space:pre-wrap"></span>volume_mapper->SetSampleDistance(0.2);</div>
<div><span style="white-space:pre-wrap"></span></div>
<div> </div>
<div><span style="white-space:pre-wrap"></span>vtkSmartPointer<vtkVolume> volume =
vtkSmartPointer<vtkVolume>::New();</div>
<div><span style="white-space:pre-wrap"></span>volume->SetMapper(volume_mapper);</div>
<div><span style="white-space:pre-wrap"></span>volume->SetProperty(volume_property);</div>
<div><span style="white-space:pre-wrap"></span>volume->Update();</div>
<div><span style="white-space:pre-wrap"></span></div>
<div><span style="white-space:pre-wrap"></span>render_window->Render();</div>
<div><span style="white-space:pre-wrap"></span>renderer->AddVolume(volume);</div>
<div><span style="white-space:pre-wrap"></span>renderer->ResetCamera();</div>
<div><span style="white-space:pre-wrap"></span></div>
<div><span style="white-space:pre-wrap"></span>render_window_interactor->Initialize();</div>
<div><span style="white-space:pre-wrap"></span>render_window->Render();</div>
<div><span style="white-space:pre-wrap"></span>render_window_interactor->Start();</div></div>
<div> </div>
<div> </div>
<div>Thanks,</div>
<div>Prathamesh</div></div>
</div></div><p>
</p><hr>
_____________________________________<br>Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br><br>Visit
other Kitware open-source projects
at<br><a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br><br>Kitware offers
ITK Training Courses, for more information
visit:<br><a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br><br>Please keep
messages on-topic and check the ITK FAQ
at:<br><a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br><br>Follow this link to
subscribe/unsubscribe:<br><a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br><p></p></div></div></div></div>
</blockquote></div><br></div></div>