fsleyes.gl.textures.selectiontexture
¶
This module provides the SelectionTexture2D
and
SelectionTexture3D
classes, Texture
types which can be used
to store Selection
instances.
The SelectionTexture2D/3D
classes are used by the VoxelSelection
annotation to display the contents of a Selection
instance.
-
class
fsleyes.gl.textures.selectiontexture.
SelectionTextureBase
(selection)[source]¶ Bases:
object
Base class shared by the
SelectionTexture2D
andSelectionTexture3D
. Manages updates from theSelection
object.-
__init__
(selection)[source]¶ This method must be called after
Texture.__init__()
.
-
destroy
()[source]¶ Must be called when this
SelectionTextureBase
is no longer needed. Removes the listener on theSelection.selection
property.
-
__selectionChanged
(*a, **kwa)¶ Called when the
Selection.selection
changes. Updates the texture data via theTexture.doPatch()
method.
-
__dict__
= mappingproxy({'__module__': 'fsleyes.gl.textures.selectiontexture', '__doc__': 'Base class shared by the :class:`SelectionTexture2D` and\n :class:`SelectionTexture3D`. Manages updates from the :class:`.Selection`\n object.\n ', '__init__': <function SelectionTextureBase.__init__>, 'selection': <property object>, 'destroy': <function SelectionTextureBase.destroy>, '_SelectionTextureBase__selectionChanged': <function SelectionTextureBase.__selectionChanged>, '__dict__': <attribute '__dict__' of 'SelectionTextureBase' objects>, '__weakref__': <attribute '__weakref__' of 'SelectionTextureBase' objects>, '__annotations__': {}})¶
-
__module__
= 'fsleyes.gl.textures.selectiontexture'¶
-
__weakref__
¶ list of weak references to the object (if defined)
-
-
class
fsleyes.gl.textures.selectiontexture.
SelectionTexture3D
(name, selection)[source]¶ Bases:
fsleyes.gl.textures.texture3d.Texture3D
,fsleyes.gl.textures.selectiontexture.SelectionTextureBase
The
SelectionTexture3D
class is aTexture3D
which can be used to store aSelection
instance. TheSelection
image array is stored as a single channel 3D texture, which is updated whenever theSelection.selection
property changes - updates are managed by theSelectionTextureBase
class.-
__init__
(name, selection)[source]¶ Create a
SelectionTexture3D
.- Parameters
name – A unique name for this
SelectionTexture3D
.selection – The
Selection
instance.
-
destroy
()[source]¶ Must be called when this
SelectionTexture3D
is no longer needed. Calls theTexture.destroy()
method, and removes the listener on theSelection.selection
property.
-
__module__
= 'fsleyes.gl.textures.selectiontexture'¶
-
-
class
fsleyes.gl.textures.selectiontexture.
SelectionTexture2D
(name, selection)[source]¶ Bases:
fsleyes.gl.textures.texture2d.Texture2D
,fsleyes.gl.textures.selectiontexture.SelectionTextureBase
The
SelectionTexture2D
class is aTexture2D
which can be used to store aSelection
instance. TheSelection
image array is stored as a single channel 2D texture, which is updated whenever theSelection.selection
property changes - updates are managed by theSelectionTextureBase
class..-
__init__
(name, selection)[source]¶ Create a
SelectionTexture2D
.- Parameters
name – A unique name for this
SelectionTexture2D
.selection – The
Selection
instance.
-
destroy
()[source]¶ Must be called when this
SelectionTexture2D
is no longer needed. Calls theTexture.destroy()
method, and removes the listener on theSelection.selection
property.
-
__module__
= 'fsleyes.gl.textures.selectiontexture'¶
-