fsleyes.gl.glrgbvolume

This module provides the GLRGBVolume class, used for rendering RGB(A) Image overlays.

class fsleyes.gl.glrgbvolume.GLRGBVolume(image, overlayList, displayCtx, canvas, threedee)[source]

Bases: fsleyes.gl.glimageobject.GLImageObject

The GLRGBVolume class is used to render RGB(A) Image overlays. The RGB(A) value at each voxel is directly used as the colour for that voxel.

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

Create a GLRGBVolume.

Parameters
  • image – The Image instance.

  • overlayList – The OverlayList

  • displayCtx – The DisplayContext managing the scene.

  • canvas – The canvas doing the drawing.

  • threedee – 2D or 3D rendering

destroy()[source]

Must be called when this GLRGBVolume is no longer needed.

addListeners()[source]

Adds listeners to Display and VolumeRGBOpts properties which should result in the display being refreshed.

removeListeners()[source]

Removes the property listeners that were added in addListeners().

ready()[source]

Returns True if this GLRGBVolume is ready to be used, False otherwise.

textureReady()[source]

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

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

Calls glrgbvolume_funcs.updateShaderState().

refreshImageTexture()[source]

(Re-)creates an ImageTexture or ImageTexture2D to store the image data.

_interpChanged(*a)[source]

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

channelColours()[source]

Returns a numpy array of shape (3, 4), containing the colours to use for each of the three channels.

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

Called before a draw. Binds the image texture.

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

Calls glrgbvolume_funcs.draw2D().

drawAll(axes, zposes, xforms)[source]

Calls glrgbvolume_funcs.drawAll().

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

Does nothing.

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

Called after a draw. Unbinds the image texture.

_GLRGBVolume__imageTextureChanged(*a)

Called when the imageTexture changes. Calls updateShaderState().

__module__ = 'fsleyes.gl.glrgbvolume'