Skip to content

Commit 0c62d74

Browse files
committed
ArrayProxy.reshape generates headerless ArrayProxy
1 parent 49725c7 commit 0c62d74

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

nibabel/arrayproxy.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,10 @@ def reshape(self, shape):
195195
if np.prod(shape) != size:
196196
raise ValueError("cannot reshape array of size {:d} into shape "
197197
"{!s}".format(size, shape))
198-
new_ap = ArrayProxy(file_like=self.file_like,
199-
header=self._header,
200-
mmap=self._mmap)
201-
new_ap._shape = shape
202-
return new_ap
198+
return ArrayProxy(file_like=self.file_like,
199+
spec=(shape, self._dtype, self._offset,
200+
self._slope, self._inter),
201+
mmap=self._mmap)
203202

204203

205204
def is_proxy(obj):

0 commit comments

Comments
 (0)