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

RF: Tweak bitmap data organisation

parent 857e255a
No related branches found
No related tags found
No related merge requests found
...@@ -64,9 +64,9 @@ class Bitmap(object): ...@@ -64,9 +64,9 @@ class Bitmap(object):
raise ValueError('unknown bitmap: {}'.format(bmp)) raise ValueError('unknown bitmap: {}'.format(bmp))
# Make the array (w, h, c) # Make the array (w, h, c)
data = data.transpose((1, 0, 2)) data = np.fliplr(data.transpose((1, 0, 2)))
w, h = data.shape[:2] data = np.array(data, dtype=np.uint8, order='C')
data = np.array(data, dtype=np.uint8, order='C') w, h = data.shape[:2]
self.__data = data self.__data = data
self.__dataSource = source self.__dataSource = source
...@@ -149,7 +149,9 @@ class Bitmap(object): ...@@ -149,7 +149,9 @@ class Bitmap(object):
else: else:
data = np.zeros((width, height), dtype=dtype) data = np.zeros((width, height), dtype=dtype)
for ch, ci in enumerate(dtype.names): for ci, ch in enumerate(dtype.names):
data[ch] = self.data[..., ci] data[ch] = self.data[..., ci]
return fslimage.Image(data, np.eye(4)) data = np.array(data, order='F', copy=False)
return fslimage.Image(data, name=self.name)
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