fsleyes.gl.textures.selectiontexture¶
This module provides the SelectionTexture class, a
Texture type which can be used to store Selection
instances.
The SelectionTexture class is used by the VoxelSelection
annotation.
-
class
fsleyes.gl.textures.selectiontexture.SelectionTexture(name, selection)¶ Bases:
fsleyes.gl.textures.texture.TextureThe
SelectionTextureclass is aTexturewhich can be used to represent aSelectioninstance. TheSelectionimage array is stored as a single channel 3D texture, which is updated whenever theSelection.selectionproperty changes, and whenever therefresh()method is called.-
__init__(name, selection)¶ Create a
SelectionTexture.Parameters: - name – A unique name for this
SelectionTexture. - selection – The
Selectioninstance.
- name – A unique name for this
-
destroy()¶ Must be called when this
SelectionTextureis no longer needed. Calls theTexture.destroy()method, and removes the listener on theSelection.selectionproperty.
-
refresh(block=None, offset=None)¶ Refreshes the texture data from the
Selectionimage data.If
blockandoffsetare not provided, the entire texture is refreshed from theSelectioninstance. If you know that only part of the selection data has changed, you can use theblockandoffsetarguments to refresh a specific region of the texture (which will be faster than a full : refresh).Parameters: - block – A 3D
numpyarray containing the new selection data. - offset – A tuple specifying the
(x, y, z)offset of theblockinto the selection array.
- block – A 3D
-
_SelectionTexture__init()¶ Called by
__init__(). Configures the GL texture.
-
_SelectionTexture__selectionChanged(*a)¶ Called when the
Selection.selectionchanges. Updates the texture data via therefresh()method.
-
__module__= 'fsleyes.gl.textures.selectiontexture'¶
-