We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ca977ab commit 4c4405bCopy full SHA for 4c4405b
nibabel/arrayproxy.py
@@ -162,6 +162,17 @@ def __getitem__(self, slicer):
162
# Upcast as necessary for big slopes, intercepts
163
return apply_read_scaling(raw_data, self._slope, self._inter)
164
165
+ def reshape(self, shape):
166
+ size = np.prod(self._shape)
167
+ if np.prod(shape) != size:
168
+ raise ValueError("cannot reshape array of size {:d} into shape "
169
+ "{!s}".format(size, shape))
170
+ new_ap = ArrayProxy(file_like=self.file_like,
171
+ header=self._header,
172
+ mmap=self._mmap)
173
+ new_ap.shape = shape
174
+ return new_ap
175
+
176
177
def is_proxy(obj):
178
""" Return True if `obj` is an array proxy
0 commit comments