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?
You want a easy way or a fast way ?
Can be done easily with the extension GL_EXT_blend_minmax :
Then render all your slices on screen.
However, it may be slow (not hardware accelerated ).
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!
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
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
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.
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).
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
Thanks, for all your comments! and I agree that maybe I
need to post in the beginers forum! :). However your comments
help me to understand what I need todo !