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)¶ Bases:
fsleyes.gl.glimageobject.GLImageObjectThe
GLMIPclass is aGLImageObjectwhich can be used to render maximum-intensity-projections of anImageoverlay onto a 2D canvas.There is no support for rending a MIP onto a 3D canvas, as the
GLVolumecan be used to achieve a MIP-like effect.To use the
GLMIP, theDisplay.overlayTypeattribute for the image must be set to'mip'. See theMIPOptsclass for more details.The
GLMIPclass uses functions defined in thegl21.glmip_funcsmodule - there is currently no support for OpenGL 1.4.-
__init__(image, overlayList, displayCtx, canvas, threedee)¶ Create a
GLMIP.- Parameters
image – An
Imageobject.overlayList – The
OverlayListdisplayCtx – The
DisplayContextobject managing the scene.canvas – The canvas doing the drawing.
threedee – Set up for 2D or 3D rendering.
-
destroy()¶ Clears up resources used by the
GLMIP.
-
addDisplayListeners()¶ Adds a bunch of listeners to the
Displayobject, and the associatedMIPOptsinstance, which define how the image should be displayed.
-
removeDisplayListeners()¶ Removes all listeners added by
addDisplayListeners().
-
refreshImageTexture()¶ Makes sure that the
ImageTexture, used to store theImagedata, is up to date.
-
refreshCmapTextures()¶ Updates the colour map texture in line with the current
DisplayandMIPOptssettings.
-
updateShaderState(*args, **kwargs)¶ Calls
gl21.glmip_funcs.updateShaderState(), andNotifier.notify(). Usesidle.idleWhen()to ensure that they don’t get called untilready()returnsTrue.
-
ready()¶ Returns
Trueif thisGLMIPis ready to be drawn,Falseotherwise.
-
textureReady()¶ Returns
Trueif theimageTextureis ready to be used,Falseotherwise.
-
preDraw(xform=None, bbox=None)¶ Binds textures.
-
draw2D(zpos, axes, xform=None, bbox=None)¶ Calls
gl21.glmip_funcs.draw2D().
-
draw3D(xform=None, bbox=None)¶ Does nothing.
-
postDraw(xform=None, bbox=None)¶ Unbinds textures.
-
_GLMIP__imageSyncChanged(*a)¶ Called when the
NiftiOpts.volumeproperty is synchronised or un-synchronised. CallsrefreshImageTexture()andupdateShaderState().
-
_GLMIP__imageTextureChanged(*a)¶ Called when the image texture data has changed. Triggers a refresh.
-
_GLMIP__interpChanged(*a)¶ Called when the
MIPOpts.interpolationchanges. Updates the image texture.
-
_GLMIP__volumeChanged(*a)¶ Called when the
NiftiOpts.volumeproperty changes. Updates the image texture accordingly.
-
__module__= 'fsleyes.gl.glmip'¶
-