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
5109b746
Commit
5109b746
authored
8 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
Changed LabelAtlas.label lookup return value. Jeez, messed up fix to
previous commit.
parent
63b11afb
Branches
filetree_json
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
fsl/data/atlases.py
+2
-2
2 additions, 2 deletions
fsl/data/atlases.py
fsl/utils/platform.py
+9
-1
9 additions, 1 deletion
fsl/utils/platform.py
with
11 additions
and
3 deletions
fsl/data/atlases.py
+
2
−
2
View file @
5109b746
...
...
@@ -411,7 +411,7 @@ class LabelAtlas(Atlas):
def
label
(
self
,
worldLoc
):
"""
Looks up and returns the label of the region at the given world
location, or ``
np.nan
`` if the location is out of bounds.
location, or ``
None
`` if the location is out of bounds.
"""
voxelLoc
=
transform
.
transform
([
worldLoc
],
self
.
worldToVoxMat
.
T
)[
0
]
...
...
@@ -423,7 +423,7 @@ class LabelAtlas(Atlas):
voxelLoc
[
0
]
>=
self
.
shape
[
0
]
or
\
voxelLoc
[
1
]
>=
self
.
shape
[
1
]
or
\
voxelLoc
[
2
]
>=
self
.
shape
[
2
]:
return
np
.
nan
return
None
val
=
self
[
voxelLoc
[
0
],
voxelLoc
[
1
],
voxelLoc
[
2
]]
...
...
This diff is collapsed.
Click to expand it.
fsl/utils/platform.py
+
9
−
1
View file @
5109b746
...
...
@@ -92,8 +92,16 @@ def isWidgetAlive(widget):
elif
platform
.
wxFlavour
==
WX_PYTHON
:
try
:
widget
.
IsEnabled
()
# GetId seems to be available on all wx
# objects, despite not being documented.
#
# I was originally calling IsEnabled,
# but this causes segfaults if called
# on a wx.MenuItem from within an
# event handler on that menu item!
widget
.
GetId
()
return
True
except
wx
.
PyDeadObjectError
:
return
False
...
...
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