-
Notifications
You must be signed in to change notification settings - Fork 265
Closed
Milestone
Description
For example, this code:
>>> import warnings
>>> warnings.simplefilter('always')
>>> import nibabel
>>> img = nibabel.load('/home/larsoner/applications/freesurfer-6/subjects/fsaverage/mri/T1.mgz')
>>> nibabel.save(img, 'test.nii')
/home/larsoner/python/nibabel/nibabel/analyze.py:1012: DeprecationWarning: get_data() is deprecated in favor of get_fdata(), which has a more predictable return type. To obtain get_data() behavior going forward, use numpy.asanyarray(img.dataobj).
* deprecated from version: 3.0
* Will raise <class 'nibabel.deprecator.ExpiredDeprecationError'> as of version: 5.0
data = self.get_data()
This suggests that there is some design issue in this nib.save
traceback, which leads up to the warning emission:
../nibabel/nibabel/loadsave.py:98: in save
img.to_filename(filename)
../nibabel/nibabel/filebasedimages.py:334: in to_filename
self.to_file_map()
../nibabel/nibabel/analyze.py:1012: in to_file_map
data = self.get_data()
Metadata
Metadata
Assignees
Labels
No labels