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:
objectBase class shared by the
SelectionTexture2DandSelectionTexture3D. Manages updates from theSelectionobject.- __init__(selection)[source]
This method must be called after
Texture.__init__().
- destroy()[source]
Must be called when this
SelectionTextureBaseis no longer needed. Removes the listener on theSelection.selectionproperty.
- __selectionChanged(*a, **kwa)
Called when the
Selection.selectionchanges. 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.SelectionTextureBaseThe
SelectionTexture3Dclass is aTexture3Dwhich can be used to store aSelectioninstance. TheSelectionimage array is stored as a single channel 3D texture, which is updated whenever theSelection.selectionproperty changes - updates are managed by theSelectionTextureBaseclass.- __init__(name, selection)[source]
Create a
SelectionTexture3D.- Parameters
name – A unique name for this
SelectionTexture3D.selection – The
Selectioninstance.
- destroy()[source]
Must be called when this
SelectionTexture3Dis no longer needed. Calls theTexture.destroy()method, and removes the listener on theSelection.selectionproperty.
- __annotations__ = {}
- __module__ = 'fsleyes.gl.textures.selectiontexture'
- class fsleyes.gl.textures.selectiontexture.SelectionTexture2D(name, selection)[source]
Bases:
fsleyes.gl.textures.texture2d.Texture2D,fsleyes.gl.textures.selectiontexture.SelectionTextureBaseThe
SelectionTexture2Dclass is aTexture2Dwhich can be used to store aSelectioninstance. TheSelectionimage array is stored as a single channel 2D texture, which is updated whenever theSelection.selectionproperty changes - updates are managed by theSelectionTextureBaseclass..- __init__(name, selection)[source]
Create a
SelectionTexture2D.- Parameters
name – A unique name for this
SelectionTexture2D.selection – The
Selectioninstance.
- destroy()[source]
Must be called when this
SelectionTexture2Dis no longer needed. Calls theTexture.destroy()method, and removes the listener on theSelection.selectionproperty.
- __annotations__ = {}
- __module__ = 'fsleyes.gl.textures.selectiontexture'