fsleyes.gl.gl21.glvolume_funcs
This module provides functions which are used by the GLVolume
class to render Image
overlays in an OpenGL 2.1 compatible manner.
A GLSLShader
is used to manage the glvolume
vertex/fragment
shader programs.
- fsleyes.gl.gl21.glvolume_funcs.init(self)[source]
Calls
compileShaders()
andupdateShaderState()
.
- fsleyes.gl.gl21.glvolume_funcs.compileShaders(self)[source]
Loads the vertex/fragment shader source, and creates a
GLSLShader
.
- fsleyes.gl.gl21.glvolume_funcs.updateShaderState(self)[source]
Updates the parameters used by the shader programs, reflecting the current display properties.
- fsleyes.gl.gl21.glvolume_funcs.preDraw(self, xform=None, bbox=None)[source]
Sets up the GL state to draw a slice from the given
GLVolume
instance.
- fsleyes.gl.gl21.glvolume_funcs.draw2D(self, zpos, axes, xform=None, bbox=None)[source]
Draws the specified 2D slice from the specified image on the canvas.
- Parameters
self – The
GLVolume
object which is managing the image to be drawn.zpos – World Z position of slice to be drawn.
axes – x, y, z axis indices.
xform – A 4*4 transformation matrix to be applied to the vertex data.
bbox – An optional bounding box.
- fsleyes.gl.gl21.glvolume_funcs.draw3D(self, xform=None, bbox=None)[source]
Draws the image in 3D on the canvas.
- Parameters
self – The
GLVolume
object which is managing the image to be drawn.xform – A 4*4 transformation matrix to be applied to the vertex data.
bbox – An optional bounding box.