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

Changed LabelAtlas.label lookup return value. Jeez, messed up fix to

previous commit.
parent 63b11afb
Branches filetree_json
No related tags found
No related merge requests found
......@@ -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]]
......
......@@ -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
......
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