Maximum intensity projection in pyqtgraph using GLVolumeItem
Question:
I would like to use the maximum intensity projection (MIP) to view some 3D medical images in pyqtgraph using GLVolumeItem. I see that there are three pre-defined GLOptions
settings. The translucent
and additive
mode both look like MIP. So my questions are
- Is it the real MIP view? If not, how should I change the
GLOptions
(e.g., GL_DEPTH_TEST
, GL_BLEND
, etc)?
- Is there a website that contains the GL configurations (e.g.,
GL_DEPTH_TEST
, GL_BLEND
, etc) for different display mode?
Update:
From this website, I set the GLOptions
to be
{'glBlendFunc': (GL_ONE, GL_ONE), 'glBlendEquation': (GL_MAX_EXT), GL_BLEND: True}
However, an error pops up saying that GL_MAX_EXT
is not defined. Any ideas how I should fix it?
Answers:
Finally I found the answer:
from OpenGL.GL import *
from OpenGL import GL
from OpenGL.GL.EXT.blend_minmax import GL_MAX_EXT
glOptions = {'glBlendFunc': (GL_ONE, GL_ONE), 'glBlendEquation': (GL_MAX_EXT, ), GL_BLEND: True}
This should give you the real MIP view.
May I ask, were you successful in this? Can the OpenGL MIP be used on a point cloud like a 3d scatter plot? I recently posted a question on it. I would greatly appreciate assistance.
I would like to use the maximum intensity projection (MIP) to view some 3D medical images in pyqtgraph using GLVolumeItem. I see that there are three pre-defined GLOptions
settings. The translucent
and additive
mode both look like MIP. So my questions are
- Is it the real MIP view? If not, how should I change the
GLOptions
(e.g.,GL_DEPTH_TEST
,GL_BLEND
, etc)? - Is there a website that contains the GL configurations (e.g.,
GL_DEPTH_TEST
,GL_BLEND
, etc) for different display mode?
Update:
From this website, I set the GLOptions
to be
{'glBlendFunc': (GL_ONE, GL_ONE), 'glBlendEquation': (GL_MAX_EXT), GL_BLEND: True}
However, an error pops up saying that GL_MAX_EXT
is not defined. Any ideas how I should fix it?
Finally I found the answer:
from OpenGL.GL import *
from OpenGL import GL
from OpenGL.GL.EXT.blend_minmax import GL_MAX_EXT
glOptions = {'glBlendFunc': (GL_ONE, GL_ONE), 'glBlendEquation': (GL_MAX_EXT, ), GL_BLEND: True}
This should give you the real MIP view.
May I ask, were you successful in this? Can the OpenGL MIP be used on a point cloud like a 3d scatter plot? I recently posted a question on it. I would greatly appreciate assistance.