Skip to content
Snippets Groups Projects
Commit 9a30c50e authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

BF: Bug in ImageWrapper for vector images

parent c65caa5a
No related branches found
No related tags found
No related merge requests found
...@@ -190,10 +190,10 @@ class ImageWrapper(notifier.Notifier): ...@@ -190,10 +190,10 @@ class ImageWrapper(notifier.Notifier):
if d == 1: self.__numRealDims -= 1 if d == 1: self.__numRealDims -= 1
else: break else: break
# Degenerate case - if every # Degenerate case - less
# dimension has length 1 # than three real dimensions
if self.__numRealDims == 0: if self.__numRealDims < 3:
self.__numRealDims = len(image.shape) self.__numRealDims = min(3, len(image.shape))
# And save the number of # And save the number of
# 'padding' dimensions too. # 'padding' dimensions too.
...@@ -705,7 +705,7 @@ class ImageWrapper(notifier.Notifier): ...@@ -705,7 +705,7 @@ class ImageWrapper(notifier.Notifier):
raise IndexError('Invalid assignment: [{}] = {}'.format( raise IndexError('Invalid assignment: [{}] = {}'.format(
sliceobj, len(values))) sliceobj, len(values)))
values = values[0] values = np.array(values).flatten()[0]
# Make sure that the values # Make sure that the values
# have a compatible shape. # have a compatible shape.
......
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