We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 70987fb commit 3351d16Copy full SHA for 3351d16
nibabel/ecat.py
@@ -708,11 +708,13 @@ def __array__(self, dtype=None):
708
Scaled image data with type `dtype`.
709
'''
710
# dtype=None is interpreted as float64
711
- data = np.empty(self.shape, dtype=dtype)
+ data = np.empty(self.shape)
712
frame_mapping = get_frame_order(self._subheader._mlist)
713
for i in sorted(frame_mapping):
714
data[:, :, :, i] = self._subheader.data_from_fileobj(
715
frame_mapping[i][0])
716
+ if dtype is not None:
717
+ data = data.astype(dtype, copy=False)
718
return data
719
720
def __getitem__(self, sliceobj):
0 commit comments