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)

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)

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()

Must be called when this GLRGBVolume is no longer needed.

addListeners()

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

removeListeners()

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

ready()

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

textureReady()

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

updateShaderState(*args, **kwargs)

Calls glrgbvolume_funcs.updateShaderState().

refreshImageTexture()

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

_interpChanged(*a)

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

channelColours()

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

preDraw(xform=None, bbox=None)

Called before a draw. Binds the image texture.

draw2D(zpos, axes, xform=None, bbox=None)

Calls glrgbvolume_funcs.draw2D().

drawAll(axes, zposes, xforms)

Calls glrgbvolume_funcs.drawAll().

draw3D(xform=None, bbox=None)

Does nothing.

postDraw(xform=None, bbox=None)

Called after a draw. Unbinds the image texture.

_GLRGBVolume__imageTextureChanged(*a)

Called when the imageTexture changes. Calls updateShaderState().

__module__ = 'fsleyes.gl.glrgbvolume'