fsleyes.gl.textures.imagetexture¶
This module provides the ImageTexture class, a Texture3D
for storing a Image instance.
-
class
fsleyes.gl.textures.imagetexture.ImageTexture(name, image, **kwargs)¶ Bases:
fsleyes.gl.textures.texture3d.Texture3DThe
ImageTextureclass contains the logic required to create and manage a 3D texture which represents aImageinstance.Once created, the
Imageinstance is available as an attribute of anImageTextureobject, calledimage. See theTexture3Ddocumentation for more details.-
__init__(name, image, **kwargs)¶ Create an
ImageTexture. A listener is added to theImage.dataproperty, so that the texture data can be refreshed whenever the image data changes - see the__imageDataChanged()method.Parameters: - name – A name for this
imageTexure. - image – The
Imageinstance. - volume – Initial volume index/indices, for >3D images.
All other arguments are passed through to the
Texture3D.__init__()method, and thus used as initial texture settings.- name – A name for this
-
destroy()¶ Must be called when this
ImageTextureis no longer needed. Deletes the texture handle, and removes the listener on theImage.dataproperty.
-
setVolume(volume)¶ For
Imageinstances with more than three dimensions, specifies the indices for the fourth and above dimensions with which to extract the 3D texture data. If the image has four dimensions, this may be a scalar, otherwise it must be a sequence of (Image.ndim - 3) the correct length.
-
set(**kwargs)¶ Overrides
Texture3D.set(). Set any parameters on thisImageTexture. This method accepts any parameters that are accepted byTexture3D.set(), plus the following:volumeSee setVolume().volRefreshIf True(the default), the texture data will be refreshed even if thevolumeparameter hasn’t changed. Otherwise, ifvolumehasn’t changed, the texture will not be refreshed.Returns: Trueif any settings have changed and theImageTextureis to be refreshed ,Falseotherwise.
-
_ImageTexture__imageDataChanged(image, topic, sliceobj)¶ Called when the
Imagenotifies about a data changes. Triggers an image texture refresh via a call toset().Parameters: - image – The
Imageinstance - topic – The string
'data' - sliceobj – Slice object specifying the portion of the image that was changed.
- image – The
-
__module__= 'fsleyes.gl.textures.imagetexture'¶
-