Surface Rendering form Volume data

Can anyone tell me how I can use volume data
(e.g. MRI images) and do surface rendering using OpenGL?

For surface rendering you first need to extract an iso-surface from the voxel set. You can do this with a number of algorithms, the most well known being the marching cubes algorithm. This results in a mesh - a set of vertices connected as triangles. Then OpenGL can render the mesh quite easily using glDrawArray() or similar…

Originally posted by Rog:
[b]For surface rendering you first need to extract an iso-surface from the voxel set. You can do this with a number of algorithms, the most well known being the marching cubes algorithm. This results in a mesh - a set of vertices connected as triangles. Then OpenGL can render the mesh quite easily using glDrawArray() or similar…

[/b]

Thanks for your reply. Can you be more specific (e.g. what are the OpenGL commands required bsides the glDrawArray().

Regards

There are no OpenGL functions for processing the volumetric data to extract an iso-surface or build a mesh. You’ll have to implement one of the well-known algorithms mentioned above in C/C++ first. There are a number of examples available if you Google for “marching cubes”.

Once you have a set of vertices, it’s easy to display the surface with OpenGL, either by using glDrawArrays(), or glVertex3f() for example. The Red Book gives all of the information you need and there are many many examples around which you can find via http://www.opengl.org - perhaps a good place to start (if you haven’t already) is http://nehe.gamedev.net

You can fake a surface rendering by putting the gradient of your data in a color 3d texture and using dot_3 bumpampping.

Originally posted by gumby:
You can fake a surface rendering by putting the gradient of your data in a color 3d texture and using dot_3 bumpampping.

Good point! (and one I hadn’t actually thought of ) - but you still need an iso-surface first so there is some element of thresholding to cause confusion and produce artefacts.