Skip to content

Commit 5576c23

Browse files
committed
BF: stride_tricks produces unwriteable array
Set unwriteable flag to prevent broadcast error
1 parent f70961a commit 5576c23

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

nibabel/parrec.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,7 @@ def __getitem__(self, slicer):
610610
# Broadcast scaling to shape of original data
611611
slopes, inters = self._slice_scaling
612612
fake_data = strided_scalar(self._shape)
613+
fake_data.flags.writeable = False
613614
_, slopes, inters = np.broadcast_arrays(fake_data, slopes, inters)
614615
# Slice scaling to give output shape
615616
return raw_data * slopes[slicer] + inters[slicer]

0 commit comments

Comments
 (0)