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)

Bases: object

Base class shared by the SelectionTexture2D and SelectionTexture3D. Manages updates from the Selection object.

__init__(selection)

This method must be called after Texture.__init__().

property selection

Returns a reference to the Selection object.

destroy()

Must be called when this SelectionTextureBase is no longer needed. Removes the listener on the Selection.selection property.

_SelectionTextureBase__selectionChanged(*a, **kwa)

Called when the Selection.selection changes. Updates the texture data via the Texture.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>})
__module__ = 'fsleyes.gl.textures.selectiontexture'
__weakref__

list of weak references to the object (if defined)

class fsleyes.gl.textures.selectiontexture.SelectionTexture3D(name, selection)

Bases: fsleyes.gl.textures.texture3d.Texture3D, fsleyes.gl.textures.selectiontexture.SelectionTextureBase

The SelectionTexture3D class is a Texture3D which can be used to store a Selection instance. The Selection image array is stored as a single channel 3D texture, which is updated whenever the Selection.selection property changes - updates are managed by the SelectionTextureBase class.

__init__(name, selection)

Create a SelectionTexture3D.

Parameters
  • name – A unique name for this SelectionTexture3D.

  • selection – The Selection instance.

destroy()

Must be called when this SelectionTexture3D is no longer needed. Calls the Texture.destroy() method, and removes the listener on the Selection.selection property.

__module__ = 'fsleyes.gl.textures.selectiontexture'
class fsleyes.gl.textures.selectiontexture.SelectionTexture2D(name, selection)

Bases: fsleyes.gl.textures.texture2d.Texture2D, fsleyes.gl.textures.selectiontexture.SelectionTextureBase

The SelectionTexture2D class is a Texture2D which can be used to store a Selection instance. The Selection image array is stored as a single channel 2D texture, which is updated whenever the Selection.selection property changes - updates are managed by the SelectionTextureBase class..

__init__(name, selection)

Create a SelectionTexture2D.

Parameters
  • name – A unique name for this SelectionTexture2D.

  • selection – The Selection instance.

destroy()

Must be called when this SelectionTexture2D is no longer needed. Calls the Texture.destroy() method, and removes the listener on the Selection.selection property.

__module__ = 'fsleyes.gl.textures.selectiontexture'