Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH: Fix
NiBabel
deprecation warnings (#83)
Fix `NiBabel` deprecation warnings: - Call `get_fdata()` instead of `get_data()`: `get_data()` is deprecated since version 3.0 and raises an error since version 5.0. - Call `affine` instead of `get_affine()`: `get_affine()` is deprecated since version 2.1 and raises an error since version 4.0. The required minimum `NiBabel` version is 3.0 as of the current `HEAD`: commit 221b068. Fixes: ``` tract_querier/scripts/query_tracts.py:138: 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 img = labels_nii.get_data() ``` and ``` tract_querier/scripts/query_tracts.py:173: DeprecationWarning: get_affine method is deprecated. Please use the ``img.affine`` property instead. * deprecated from version: 2.1 * Will raise <class 'nibabel.deprecator.ExpiredDeprecationError'> as of version: 4.0 affine_ijk_2_ras = labels_nii.get_affine() ``` raised locally when running the `tract_querier` script.
- Loading branch information