Hi Sason,<div><br></div><div>VTK has CPU and GPU implementations for raycasting volume rendering. For more information about the GPU ray cast mapper, you can read July 2008 edition of The Source: <meta http-equiv="content-type" content="text/html; charset=utf-8"><a href="http://www.kitware.com/products/archive/kitware_quarterly0708.pdf">http://www.kitware.com/products/archive/kitware_quarterly0708.pdf</a> (the mapper was previously in VTKEdge but is now in VTK).</div>
<div><br></div><div>Some doxygen doc:</div><div><a href="http://www.vtk.org/doc/nightly/html/classvtkFixedPointVolumeRayCastMapper.html">http://www.vtk.org/doc/nightly/html/classvtkFixedPointVolumeRayCastMapper.html</a></div>
<div><a href="http://www.vtk.org/doc/nightly/html/classvtkGPUVolumeRayCastMapper.html">http://www.vtk.org/doc/nightly/html/classvtkGPUVolumeRayCastMapper.html</a></div><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><a href="http://www.vtk.org/doc/nightly/html/classvtkSmartVolumeMapper.html">http://www.vtk.org/doc/nightly/html/classvtkSmartVolumeMapper.html</a></div>
<div><br></div><div>Hope this helps,</div><div>Julien.<br><br><div class="gmail_quote">On Mon, May 9, 2011 at 9:31 AM, Sason Ohanian Saki <span dir="ltr"><<a href="mailto:sason@kth.se">sason@kth.se</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi!<br>
<br>
I am wondering If anyone knows how volume rendering with ray casting is implemented in VTK? Is it a software implementation or hardware-accelerated with shaders?<br>
<br>
Thanks!<br>
<br>
/Sason<br>
<br>
7 maj 2011 kl. 23.25 skrev David Gobbi:<br>
<br>
> The only way that I know of is to get the range directly from the scalars,<br>
><br>
> double range[2];<br>
> data->GetPointData()->GetScalars()->GetRange(range, component);<br>
><br>
> Personally, I would not be opposed to changing vtkDataSet::ComputeRange()<br>
> so that it computed the range over all components.<br>
><br>
> David<br>
><br>
><br>
> On Sat, May 7, 2011 at 1:37 PM, Nicolas Rannou<br>
> <<a href="mailto:Nicolas_Rannou@hms.harvard.edu">Nicolas_Rannou@hms.harvard.edu</a>> wrote:<br>
>> Hi David,<br>
>><br>
>> Thanks for the clarification.<br>
>> Which is the best practice to get the scalar range of each component then?<br>
>><br>
>><br>
>> On May 6, 2011, at 5:53 PM, David Gobbi wrote:<br>
>><br>
>>> Hi Nicolas,<br>
>>><br>
>>> The GetScalarRange() method computes the scalar range of the first component.<br>
>>><br>
>>> - David<br>
>>><br>
>>><br>
>>> On Fri, May 6, 2011 at 3:00 PM, Nicolas Rannou<br>
>>> <<a href="mailto:nicolas_rannou@hms.harvard.edu">nicolas_rannou@hms.harvard.edu</a>> wrote:<br>
>>>> Hello,<br>
>>>><br>
>>>> I'm experiencing a strange behavior in VTK which might be a bug.<br>
>>>> It took me a while to locate the issue:<br>
>>>><br>
>>>> if I create a LUT with a NULL red component:<br>
>>>> iRed = 0;<br>
>>>> iGreen = 255;<br>
>>>> iBlue = 255;<br>
>>>> iAlpha = 255;<br>
>>>> double iRange[2] = {0, 255};<br>
>>>><br>
>>>> vtkSmartPointer<vtkLookupTable> lut =<br>
>>>> vtkSmartPointer<vtkLookupTable>::New();<br>
>>>> double* HSV = vtkMath::RGBToHSV(iRed,iGreen,iBlue);<br>
>>>> lut->SetAlpha(iAlpha);<br>
>>>> lut->SetHueRange(HSV[0], HSV[0]);<br>
>>>> lut->SetSaturationRange(1, 1);<br>
>>>> lut->SetValueRange(0, 1);<br>
>>>> lut->SetRange(iRange);<br>
>>>> lut->Build();<br>
>>>><br>
>>>> I color my image with this LUT:<br>
>>>><br>
>>>> vtkSmartPointer<vtkImageMapToColors> coloredImage =<br>
>>>> vtkSmartPointer<vtkImageMapToColors>::New();<br>
>>>> coloredImage->SetLookupTable(iLUT);<br>
>>>> coloredImage->SetInput( iImage );<br>
>>>> coloredImage->PassAlphaToOutputOff();<br>
>>>> coloredImage->SetOutputFormatToRGB();<br>
>>>> coloredImage->Update();<br>
>>>><br>
>>>> then:<br>
>>>> double* range = coloredImage->GetOutput()->GetScalarRange();<br>
>>>> returns [0,0].<br>
>>>> then everything I do with this image is messed up...<br>
>>>><br>
>>>> If iRed != 0, the scalar range of the "coloredImage" will be correct then my<br>
>>>> pipeline is working.<br>
>>>><br>
>>>> Am I doing something wrong?<br>
>>>><br>
>>>> Thanks,<br>
>>>><br>
>>>> Nicolas<br>
> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.vtk.org/mailman/listinfo/vtk-developers" target="_blank">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>
><br>
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtk-developers" target="_blank">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>
<br>
</blockquote></div><br></div>