Commit 8d1ca63e authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

BF,RF: Texture.texCoordXform is passed the data shape sans nvalues, so should

not drop the first entry. GLRGBVolume adjusts texture coordinates for 2D
images.
parent 8c131572
......@@ -13,6 +13,7 @@ import numpy as np
import OpenGL.GL as gl
import fsl.utils.idle as idle
import fsl.transform.affine as affine
import fsleyes.gl as fslgl
import fsleyes.gl.routines as glroutines
......@@ -190,6 +191,23 @@ class GLRGBVolume(glimageobject.GLImageObject):
self.updateShaderState()
def generateVertices2D(self, zpos, axes, bbox=None):
"""Overrides :meth:`.GLImageObject.generateVertices2D`.
Appliies the :meth:`.ImageTextureBase.texCoordXform` to the texture
coordinates - this is performed to support 2D images/textures.
"""
vertices, voxCoords, texCoords = \
glimageobject.GLImageObject.generateVertices2D(
self, zpos, axes, bbox)
texCoords = affine.transform(
texCoords, self.imageTexture.texCoordXform(self.overlay.shape))
return vertices, voxCoords, texCoords
def channelColours(self):
"""Returns a ``numpy`` array of shape ``(3, 4)``, containing the
colours to use for each of the three channels.
......
......@@ -303,9 +303,6 @@ class Texture2D(texture.Texture):
if origShape is None:
return None
if self.nvals > 1:
origShape = origShape[1:]
# Here we apply a rotation to the
# coordinates to force the two major
# voxel axes to map to the first two
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment