Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fslpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michiel Cottaar
fslpy
Commits
111707ec
Commit
111707ec
authored
9 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
Bugfix - GLImageObject.getDataResolution was returning bad resolution values.
parent
dac9ae74
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
fsl/fsleyes/gl/globject.py
+3
-2
3 additions, 2 deletions
fsl/fsleyes/gl/globject.py
fsl/fsleyes/gl/textures/rendertexture.py
+2
-8
2 additions, 8 deletions
fsl/fsleyes/gl/textures/rendertexture.py
with
5 additions
and
10 deletions
fsl/fsleyes/gl/globject.py
+
3
−
2
View file @
111707ec
...
...
@@ -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
())
m
in
res
=
int
(
round
(((
hi
-
lo
)
/
res
).
m
in
()))
return
[
m
in
res
]
*
3
m
ax
res
=
int
(
round
(((
hi
-
lo
)
/
res
).
m
ax
()))
return
[
m
ax
res
]
*
3
def
generateVertices
(
self
,
zpos
,
xform
):
...
...
This diff is collapsed.
Click to expand it.
fsl/fsleyes/gl/textures/rendertexture.py
+
2
−
8
View file @
111707ec
...
...
@@ -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
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment