fsleyes.gl.glmip

The GLMIP class can be used to render maximum-intensity-projections of an Image overlay onto a 2D canvas.

class fsleyes.gl.glmip.GLMIP(image, overlayList, displayCtx, canvas, threedee)[source]

Bases: fsleyes.gl.glimageobject.GLImageObject

The GLMIP class is a GLImageObject which can be used to render maximum-intensity-projections of an Image overlay onto a 2D canvas.

There is no support for rending a MIP onto a 3D canvas, as the GLVolume can be used to achieve a MIP-like effect.

To use the GLMIP, the Display.overlayType attribute for the image must be set to 'mip'. See the MIPOpts class for more details.

The GLMIP class uses functions defined in the gl21.glmip_funcs module - there is currently no support for OpenGL 1.4.

__init__(image, overlayList, displayCtx, canvas, threedee)[source]

Create a GLMIP.

Parameters
  • image – An Image object.

  • overlayList – The OverlayList

  • displayCtx – The DisplayContext object managing the scene.

  • canvas – The canvas doing the drawing.

  • threedee – Set up for 2D or 3D rendering.

destroy()[source]

Clears up resources used by the GLMIP.

addDisplayListeners()[source]

Adds a bunch of listeners to the Display object, and the associated MIPOpts instance, which define how the image should be displayed.

removeDisplayListeners()[source]

Removes all listeners added by addDisplayListeners().

refreshImageTexture()[source]

Makes sure that the ImageTexture, used to store the Image data, is up to date.

refreshCmapTextures()[source]

Updates the colour map texture in line with the current Display and MIPOpts settings.

updateShaderState(*args, **kwargs)[source]

Calls gl21.glmip_funcs.updateShaderState(), and Notifier.notify(). Uses idle.idleWhen() to ensure that they don’t get called until ready() returns True.

ready()[source]

Returns True if this GLMIP is ready to be drawn, False otherwise.

textureReady()[source]

Returns True if the imageTexture is ready to be used, False otherwise.

preDraw(xform=None, bbox=None)[source]

Binds textures.

draw2D(zpos, axes, xform=None, bbox=None)[source]

Calls gl21.glmip_funcs.draw2D().

draw3D(xform=None, bbox=None)[source]

Does nothing.

postDraw(xform=None, bbox=None)[source]

Unbinds textures.

__volumeChanged(*a)

Called when the NiftiOpts.volume property changes. Updates the image texture accordingly.

__interpChanged(*a)

Called when the MIPOpts.interpolation changes. Updates the image texture.

__imageTextureChanged(*a)

Called when the image texture data has changed. Triggers a refresh.

__imageSyncChanged(*a)

Called when the NiftiOpts.volume property is synchronised or un-synchronised. Calls refreshImageTexture() and updateShaderState().

__module__ = 'fsleyes.gl.glmip'