Simple volume ray casting
The question might be simple, but I realize the answer may not be. To keep it as clear as possible.
Can yo开发者_Go百科u explain the basic idea for the Volume Ray Casting technique in 3d volume rendering.
Cheers, Timo
This reference presents a reasonable introduction to simple raycasting link. Those concepts (ray-plane intersections, etc) can then be extended to volume ray casting link.
To summarize, the ray is cast through the volume and accumulates some color with each intersection that meets some criteria. For example, each voxel along the ray possessing a value > 128 might contribute some small percentage of opacity for a desired RGB color. The degree of opacity is weighted, (voxel_value - 128)/127 might be a suitable weighting function in this simplified case (assuming negative values are handled appropriately). This scheme would represent a proportional, thresholded transfer function. For rendering, the pixel associated with the ray is assigned a color determined by the summed opacities encountered along its path. (This would be a front-to-back alpha blending - other methods exist.)
Other transfer functions exist, as well: some functions might weight gradients heavily. This sort of function might be used to visualize surface boundaries occurring within the volume.
I recommend the VTK books for further reading.
I've written a couple posts on ray-casting and ray-tracing with Python and VTK in my blog (PyScience):
http://pyscience.wordpress.com/2014/09/21/ray-casting-with-python-and-vtk-intersecting-linesrays-with-surface-meshes/
http://pyscience.wordpress.com/2014/10/05/from-ray-casting-to-ray-tracing-with-python-and-vtk/
However, I realize those ray techniques aren't particular to volume rendering (even though they could be used as such). For pure volume rendering, the vtkVolumeRayCastMapper class does the trick (haven't written a post on that yet :) )
精彩评论