Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fslpy
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD 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
FSL
fslpy
Commits
da7e9f41
Commit
da7e9f41
authored
10 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
Variable name change
parent
821dd099
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
fsl/fslview/slicecanvas.py
+11
-13
11 additions, 13 deletions
fsl/fslview/slicecanvas.py
with
11 additions
and
13 deletions
fsl/fslview/slicecanvas.py
+
11
−
13
View file @
da7e9f41
...
...
@@ -435,12 +435,12 @@ class SliceCanvas(wxgl.GLCanvas):
ev
,
canvasWidth
=
None
,
canvasHeight
=
None
,
real
Width
=
None
,
real
Height
=
None
):
world
Width
=
None
,
world
Height
=
None
):
"""
Calculates the best size to draw the slice, maintaining its
aspect ratio, within the current canvas size. The
real
Width/
real
Height parameters, if provided, are used
world
Width/
world
Height parameters, if provided, are used
to calculate the displayed world space aspect ratio. If not
provided, they are calculated from the min/max bounds of
the displayed image list.
...
...
@@ -454,23 +454,23 @@ class SliceCanvas(wxgl.GLCanvas):
# canvas is not yet displayed
if
canvasWidth
==
0
or
\
canvasHeight
==
0
or
\
real
Width
==
0
or
\
real
Height
==
0
:
world
Width
==
0
or
\
world
Height
==
0
:
return
canvasWidth
=
float
(
canvasWidth
)
canvasHeight
=
float
(
canvasHeight
)
if
real
Width
is
None
:
real
Width
=
float
(
abs
(
self
.
xmax
-
self
.
xmin
))
if
real
Height
is
None
:
real
Height
=
float
(
abs
(
self
.
ymax
-
self
.
ymin
))
if
world
Width
is
None
:
world
Width
=
float
(
abs
(
self
.
xmax
-
self
.
xmin
))
if
world
Height
is
None
:
world
Height
=
float
(
abs
(
self
.
ymax
-
self
.
ymin
))
real
Ratio
=
real
Width
/
real
Height
world
Ratio
=
world
Width
/
world
Height
canvasRatio
=
canvasWidth
/
canvasHeight
if
canvasRatio
>=
real
Ratio
:
canvasWidth
=
real
Width
*
(
canvasHeight
/
real
Height
)
if
canvasRatio
>=
world
Ratio
:
canvasWidth
=
world
Width
*
(
canvasHeight
/
world
Height
)
else
:
canvasHeight
=
real
Height
*
(
canvasWidth
/
real
Width
)
canvasHeight
=
world
Height
*
(
canvasWidth
/
world
Width
)
canvasWidth
=
int
(
np
.
floor
(
canvasWidth
))
canvasHeight
=
int
(
np
.
floor
(
canvasHeight
))
...
...
@@ -484,8 +484,6 @@ class SliceCanvas(wxgl.GLCanvas):
self
.
_canvasBBox
=
[
x
,
y
,
canvasWidth
,
canvasHeight
]
return
canvasWidth
,
canvasHeight
def
_resize
(
self
,
bbox
=
None
,
...
...
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