fsleyes.gl.gl21.gltensor_funcs
¶
This module provides functions which are used by the GLTensor
class for rendering DTIFitTensor
overlays, and compatible
Image
overlays in an OpenGL 2.1 compatible manner.
The rendering code makes use of the OpenGL ARB_draw_instanced
extension
so that voxel coordinates do not need to be repeated for every vertex of
a single tensor.
For each voxel, the vertices of a unit sphere are passed to the gltensor
vertex shader, which looks up the eigenvectors and values for the voxel, and
transforms the sphere accordingly.
If the VectorOpts.colourImage
property is not set, the glvector
fragment shader is used to colour the tensors. Otherwise, the glvolume
fragment shader is used to colour the tensors according to the specified
colourImage
. The functions in the gl21.glvector_funcs
module
are used to manage the fragment shader.
-
fsleyes.gl.gl21.gltensor_funcs.
init
(self)[source]¶ Calls
compileShaders()
andupdateShaderState()
.
-
fsleyes.gl.gl21.gltensor_funcs.
destroy
(self)[source]¶ Deletes the
GLSLShader
.
-
fsleyes.gl.gl21.gltensor_funcs.
compileShaders
(self)[source]¶ Creates a
GLSLShader
for drawing thisGLTensor
. This is done via a call togl21.glvector_funcs.compileShaders()
.
-
fsleyes.gl.gl21.gltensor_funcs.
updateShaderState
(self)[source]¶ Updates the state of the vertex and fragment shaders. The fragment shader is updated via the
gl21.glvector_funcs.updateShaderState()
function.
-
fsleyes.gl.gl21.gltensor_funcs.
preDraw
(self, xform=None, bbox=None)[source]¶ Must be called before
draw()
. Loads the shader programs, and does some shader state configuration.