I am now trying to implement Ray Casting Volume Rendering using C++, OpenGL and GLSL (for GPU speeding). In order to get better quality and performance, I want to use octree to organize the 3D medical volume data,so I can use some algorithm such as Space Leaping and Adaptive Sampling easily.
But how to build the octree effectively? How to visit the octree? When the ray travels in the volume data, how can I determine which cell or leaf of the octree the sample point belong?
There is an excellent article on GPU octree's available here (there is also source available here). It is based on Cg however, but that can be consider more an advantage.
Seeing as you are using medical data, with is more data dense, you may also be interested in Cyril Crassin's Ph. D Thesis, which uses streaming GPU sparse octree's for organisation of dense voxel data. Here the octree is built on the GPU using a 3D volume texture for data storage(leaf nodes) and a brick pool for allocating internal nodes, built from the bottom up then mip-map'ed for ray casting.
If you are willing to bend a bit, there is a big project on sparse voxel octree's using CUDA, which would provide valuable insight into sparse octree's and ray-casting into them.