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.Texture3D
The
ImageTexture
class contains the logic required to create and manage a 3D texture which represents aImage
instance.Once created, the
Image
instance is available as an attribute of anImageTexture
object, calledimage
. See theTexture3D
documentation for more details.-
__init__
(name, image, **kwargs)¶ Create an
ImageTexture
. A listener is added to theImage.data
property, 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
Image
instance. - 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
ImageTexture
is no longer needed. Deletes the texture handle, and removes the listener on theImage.data
property.
-
setVolume
(volume)¶ For
Image
instances 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:volume
See setVolume()
.volRefresh
If True
(the default), the texture data will be refreshed even if thevolume
parameter hasn’t changed. Otherwise, ifvolume
hasn’t changed, the texture will not be refreshed.Returns: True
if any settings have changed and theImageTexture
is to be refreshed ,False
otherwise.
-
_ImageTexture__imageDataChanged
(image, topic, sliceobj)¶ Called when the
Image
notifies about a data changes. Triggers an image texture refresh via a call toset()
.Parameters: - image – The
Image
instance - topic – The string
'data'
- sliceobj – Slice object specifying the portion of the image that was changed.
- image – The
-
__module__
= 'fsleyes.gl.textures.imagetexture'¶
-