PDA

View Full Version : Maximum Intensity Projection

dinara
06-09-2009, 08:29 PM
I have a 3D image volume data (from an PET scanner), and I would like to produce a maximum intensity images of the data. Is there an easy way to do that in OpenGL?

ZbuffeR
06-10-2009, 12:05 AM
You want a easy way or a fast way ?

Can be done easily with the extension GL_EXT_blend_minmax :
glBlendEquationEXT(GL_MAX_EXT);

Then render all your slices on screen.

However, it may be slow (not hardware accelerated ).

dinara
06-10-2009, 10:26 AM
For the moment I want an easy way, I already know about that
function, but I do not know how to use it :(
I have the "Advanced graphics programming using OpenGL", and for the MIP topi, there is only one pararaph introducing that function.

Do you have some code example that I could see to figure out how to use this function? or if you have a reference for medical image visualisation using OpenGL, I will appreciate that!

Best regards,

ZbuffeR
06-10-2009, 11:23 AM
I do not know how to use it
Just put it in your code, around enabling blending and such.
As you posted in the advanced forum, I though you were used to using GL extensions. Apparently it is not the case, so have a look here : http://www.opengl.org/wiki/Getting_started#OpenGL_2.0.2B_and_extensions

strattonbrazil
06-10-2009, 11:31 AM
Blending in OpenGL is comparing the fragment going in (src) and fragment sitting in the buffer (dst). If you think about the equation that calculates the final pixel color that goes into the buffer, it's something like

finalColor = blendingEq(blendFunc1(src), blendFunc2(dst))

where blendingEq can add them or subtract them or multiply them, or as dinara suggests, return the higher (max) value. For most OpenGL stuff like transparency, people usually leave this equation alone since adding is the default.

So basically if you call

glBlendEquationEXT(GL_MAX_EXT);

then when you enable blending and have glBlendFunc set, it will compare those two values, take the max value (per channel I believe), and put that into the framebuffer when you render a slice.

Eosie
06-10-2009, 02:19 PM
No need to use EXT_blend_minmax, this is already in OpenGL 1.4 and later versions (see section G.3 in the 2.1 spec).

zed
06-10-2009, 03:40 PM
also WRT EXT_blend_minmax last time I used it (years ago) it was hardware accelerated thus by now you shouldnt worry about it to much of it being slow

dinara
06-11-2009, 05:14 PM