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.Texture
The
SelectionTexture
class is aTexture
which can be used to represent aSelection
instance. TheSelection
image array is stored as a single channel 3D texture, which is updated whenever theSelection.selection
property changes, and whenever therefresh()
method is called.-
__init__
(name, selection)¶ Create a
SelectionTexture
.Parameters: - name – A unique name for this
SelectionTexture
. - selection – The
Selection
instance.
- name – A unique name for this
-
destroy
()¶ Must be called when this
SelectionTexture
is no longer needed. Calls theTexture.destroy()
method, and removes the listener on theSelection.selection
property.
-
refresh
(block=None, offset=None)¶ Refreshes the texture data from the
Selection
image data.If
block
andoffset
are not provided, the entire texture is refreshed from theSelection
instance. If you know that only part of the selection data has changed, you can use theblock
andoffset
arguments to refresh a specific region of the texture (which will be faster than a full : refresh).Parameters: - block – A 3D
numpy
array containing the new selection data. - offset – A tuple specifying the
(x, y, z)
offset of theblock
into the selection array.
- block – A 3D
-
_SelectionTexture__init
()¶ Called by
__init__()
. Configures the GL texture.
-
_SelectionTexture__selectionChanged
(*a)¶ Called when the
Selection.selection
changes. Updates the texture data via therefresh()
method.
-
__module__
= 'fsleyes.gl.textures.selectiontexture'¶
-