PDA

View Full Version : Surface Rendering form Volume data



jacobl
11-19-2003, 09:08 PM
Can anyone tell me how I can use volume data
(e.g. MRI images) and do surface rendering using OpenGL?

Rog
11-19-2003, 09:58 PM
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......

jacobl
11-21-2003, 07:10 PM
Originally posted by Rog:
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......


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

Regards

Rog
11-22-2003, 01:01 AM
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

gumby
11-22-2003, 12:40 PM
You can fake a surface rendering by putting the gradient of your data in a color 3d texture and using dot_3 bumpampping.

Rog
11-22-2003, 01:57 PM
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 http://www.opengl.org/discussion_boards/ubb/smile.gif ) - but you still need an iso-surface first so there is some element of thresholding to cause confusion and produce artefacts.