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

Vector overlay types were not being restricted

parent f954d1f6
No related branches found
No related tags found
No related merge requests found
......@@ -100,7 +100,10 @@ class ListItemWidget(wx.Panel):
if ev.GetEventObject() is not self:
return
group = self.displayCtx.overlayGroups[0]
self.display.removeListener('enabled', self.name)
group .removeListener('overlays', self.name)
if isinstance(self.overlay, fslimage.Image):
self.overlay.removeListener('saved', self.name)
......
......@@ -165,8 +165,19 @@ class Display(props.SyncableHasProperties):
# Populate the possible choices
# for the overlayType property
overlayTypeProp = self.getProp('overlayType')
possibleTypes = OVERLAY_TYPES[overlay]
possibleTypes = list(OVERLAY_TYPES[overlay])
# Special cases:
#
# If the overlay is an image which
# does not have a fourth dimension
# of length three, it can't be
# a vector
if isinstance(overlay, fslimage.Image) and \
(len(overlay.shape) != 4 or overlay.shape[-1] != 3):
possibleTypes.remove('rgbvector')
possibleTypes.remove('linevector')
for pt in possibleTypes:
log.debug('Enabling overlay type {} for {}'.format(pt, overlay))
label = strings.choices[self, 'overlayType', pt]
......
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