Skip to content

Commit 587a6c7

Browse files
authored
Merge pull request #638 from matthew-brett/array-image-casting
MRG: fix bug in get_fdata return value
2 parents dfd113c + 58c8d1a commit 587a6c7

File tree

2 files changed

+197
-169
lines changed

2 files changed

+197
-169
lines changed

nibabel/dataobj_images.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ def get_fdata(self, caching='fill', dtype=np.float64):
344344
if self._fdata_cache is not None:
345345
if self._fdata_cache.dtype.type == dtype.type:
346346
return self._fdata_cache
347-
data = np.asanyarray(self._dataobj).astype(dtype)
347+
data = np.asanyarray(self._dataobj).astype(dtype, copy=False)
348348
if caching == 'fill':
349349
self._fdata_cache = data
350350
return data

0 commit comments

Comments
 (0)