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

Bugfix - GLImageObject.getDataResolution was returning bad resolution values.

parent dac9ae74
No related branches found
No related tags found
No related merge requests found
......@@ -388,14 +388,15 @@ class GLImageObject(GLObject):
pixdim = np.array(image.pixdim[:3])
steps = [res, res, res] / pixdim
steps = np.maximum(steps, [1, 1, 1])
res = image.shape[:3] / steps
return np.array(res.round(), dtype=np.uint32)
else:
lo, hi = map(np.array, self.getDisplayBounds())
minres = int(round(((hi - lo) / res).min()))
return [minres] * 3
maxres = int(round(((hi - lo) / res).max()))
return [maxres] * 3
def generateVertices(self, zpos, xform):
......
......@@ -382,7 +382,6 @@ class GLObjectRenderTexture(RenderTexture):
(width, height)))
if width > maxRes or height > maxRes:
oldWidth, oldHeight = width, height
ratio = min(width, height) / float(max(width, height))
if width > height:
......@@ -395,12 +394,7 @@ class GLObjectRenderTexture(RenderTexture):
width = int(round(width))
height = int(round(height))
log.debug('Limiting texture resolution to {}x{} '
'(for {} resolution {}x{})'.format(
width,
height,
type(globj).__name__,
oldWidth,
oldHeight))
log.debug('Setting {} texture resolution to {}x{}'.format(
type(globj).__name__, width, height))
RenderTexture.setSize(self, width, height)
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