Skip to content

Commit e2873a0

Browse files
committed
Make shape a writable ndarray
For the record, I don't think this will help.
1 parent 76e8023 commit e2873a0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

nibabel/fileslice.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,6 @@ def strided_scalar(shape, scalar=0.):
770770
out to the full array `shape`.
771771
"""
772772
shape = tuple(shape)
773-
scalar = np.zeros((1,), dtype=type(scalar)) + scalar
773+
scalar = np.array(scalar)
774774
strides = [0] * len(shape)
775775
return np.lib.stride_tricks.as_strided(scalar, shape, strides)

nibabel/parrec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ def __getitem__(self, slicer):
609609
'F')
610610
# Broadcast scaling to shape of original data
611611
slopes, inters = self._slice_scaling
612-
fake_data = strided_scalar(self._shape)
612+
fake_data = strided_scalar(np.array(self._shape))
613613
_, slopes, inters = np.broadcast_arrays(fake_data, slopes, inters)
614614
# Slice scaling to give output shape
615615
return raw_data * slopes[slicer] + inters[slicer]

0 commit comments

Comments
 (0)