Skip to content
Snippets Groups Projects
Commit b9ecd8ef authored by Paul McCarthy's avatar Paul McCarthy
Browse files

Simplified ImageTexture constructor.

parent c7e65614
No related branches found
No related tags found
No related merge requests found
...@@ -65,12 +65,8 @@ class ImageTexture(texture.Texture, notifier.Notifier): ...@@ -65,12 +65,8 @@ class ImageTexture(texture.Texture, notifier.Notifier):
name, name,
image, image,
nvals=1, nvals=1,
normalise=False, notify=True,
prefilter=None, **kwargs):
interp=gl.GL_NEAREST,
resolution=None,
volume=None,
notify=True):
"""Create an ``ImageTexture``. A listener is added to the """Create an ``ImageTexture``. A listener is added to the
:attr:`.Image.data` property, so that the texture data can be :attr:`.Image.data` property, so that the texture data can be
refreshed whenever the image data changes - see the refreshed whenever the image data changes - see the
...@@ -83,15 +79,11 @@ class ImageTexture(texture.Texture, notifier.Notifier): ...@@ -83,15 +79,11 @@ class ImageTexture(texture.Texture, notifier.Notifier):
:arg nvals: Number of values per voxel. For example. a normal MRI :arg nvals: Number of values per voxel. For example. a normal MRI
or fMRI image contains only one value for each voxel. or fMRI image contains only one value for each voxel.
However, DTI data contains three values per voxel. However, DTI data contains three values per voxel.
:arg normalise: If ``True``, the image data is normalised to lie in the
range ``[0.0, 1.0]``.
:arg prefilter: An optional function which may perform any
pre-processing on the data before it is copied to the
GPU - see the :meth:`__prepareTextureData` method.
:arg notify: Passed to the initial call to :meth:`refresh`. :arg notify: Passed to the initial call to :meth:`refresh`.
All other keyword arguments are passed through to the :meth:`set`
method, and thus used as initial texture settings.
""" """
texture.Texture.__init__(self, name, 3) texture.Texture.__init__(self, name, 3)
...@@ -127,12 +119,7 @@ class ImageTexture(texture.Texture, notifier.Notifier): ...@@ -127,12 +119,7 @@ class ImageTexture(texture.Texture, notifier.Notifier):
self.image.addListener('data', self.__name, self.refresh) self.image.addListener('data', self.__name, self.refresh)
self.set(interp=interp, self.set(refresh=False, **kwargs)
prefilter=prefilter,
resolution=resolution,
volume=volume,
normalise=normalise,
refresh=False)
self.__refresh(notify=notify) self.__refresh(notify=notify)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment