fsleyes.gl.gl21.gllinevector_funcs

This module provides functions which are used by the GLLineVector class to render Image overlays as line vector images in an OpenGL 2.1 compatible manner.

This module uses functions in the gl21.glvector_funcs module, which contains logic used for rendering both GLRGBVector and GLLineVector instances.

The voxel coordinates for every vector are passed directly to a vertex shader program which calculates the position of the corresponding line vertices.

The glvector fragment shader (the same as that used by the GLRGBVector class) is used to colour each line according to the orientation of the underlying vector.

fsleyes.gl.gl21.gllinevector_funcs.init(self)[source]

Compiles and configures the vertex/fragment shaders used to render the GLLineVector via calls to compileShaders() and updateShaderState().

fsleyes.gl.gl21.gllinevector_funcs.destroy(self)[source]

Deletes the vertex/fragment shaders.

fsleyes.gl.gl21.gllinevector_funcs.compileShaders(self)[source]

Compiles the vertex/fragment shaders via the gl21.glvector_funcs.compileShaders() function.

fsleyes.gl.gl21.gllinevector_funcs.updateShaderState(self)[source]

Updates all variables used by the vertex/fragment shaders. The fragment shader is configured by the gl21.glvector_funcs.updateFragmentShaderState() function.

fsleyes.gl.gl21.gllinevector_funcs.preDraw(self, xform=None, bbox=None)[source]

Prepares the GL state for drawing. This amounts to loading the vertex/fragment shader programs.

fsleyes.gl.gl21.gllinevector_funcs.draw2D(self, zpos, axes, xform=None, bbox=None)[source]

Draws the line vectors at a plane at the specified Z location. Voxel coordinates are passed to the vertex shader, which calculates the corresponding line vertex locations.

fsleyes.gl.gl21.gllinevector_funcs.draw3D(self, xform=None, bbox=None)[source]

Draws the line vectors in 3D space.

fsleyes.gl.gl21.gllinevector_funcs.drawAll(self, axes, zposes, xforms)[source]

Draws the line vectors at every slice specified by the Z locations.

fsleyes.gl.gl21.gllinevector_funcs.postDraw(self, xform=None, bbox=None)[source]

Clears the GL state after drawing.