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
Package registry
Model registry
Operate
Environments
Terraform modules
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
Evan Edmond
fslpy
Commits
a54ea723
Commit
a54ea723
authored
10 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
A couple of guards in locationpanel.py to preserve the real world
location across changes in the selected image.
parent
ba525f80
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/locationpanel.py
+15
-0
15 additions, 0 deletions
fsl/fslview/locationpanel.py
with
15 additions
and
0 deletions
fsl/fslview/locationpanel.py
+
15
−
0
View file @
a54ea723
...
...
@@ -110,6 +110,13 @@ class LocationPanel(wx.Panel, props.HasProperties):
image
=
self
.
imageList
[
self
.
imageList
.
selectedImage
]
voxLoc
=
self
.
voxelLocation
.
xyz
# There's a chance that the voxel location will temporarily
# be out of bounds when the selected image is changed.
# So we'll be safe and check them.
for
i
in
range
(
3
):
if
voxLoc
[
i
]
<=
0
or
voxLoc
[
i
]
>=
image
.
shape
[
i
]:
return
# 3D image
if
len
(
image
.
shape
)
==
3
:
voxVal
=
image
.
data
[
voxLoc
[
0
],
voxLoc
[
1
],
voxLoc
[
2
]]
...
...
@@ -188,5 +195,13 @@ class LocationPanel(wx.Panel, props.HasProperties):
self
.
_voxelLabel
.
SetLabel
(
'
Voxel coordinates ({})
'
.
format
(
image
.
name
))
self
.
_voxelPanel
.
Layout
()
oldLoc
=
self
.
imageList
.
location
.
xyz
for
i
in
range
(
3
):
self
.
voxelLocation
.
setLimits
(
i
,
0
,
image
.
shape
[
i
]
-
1
)
# The voxel coordinates may have inadvertently been
# changed due to a change in their limits. So we'll
# restore the old location from the real world
# coordinates.
oldLoc
=
self
.
imageList
.
location
.
xyz
=
oldLoc
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