Warm tip: This article is reproduced from stackoverflow.com, please click
opengl python pyqtgraph

Maximum intensity projection in pyqtgraph using GLVolumeItem

发布于 2020-03-27 10:31:42

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

  1. Is it the real MIP view? If not, how should I change the GLOptions (e.g., GL_DEPTH_TEST, GL_BLEND, etc)?
  2. 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?

Questioner
zjx1805
Viewed
59
zjx1805 2019-07-16 04:59

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.