io.nibcompat¶
Module: io.nibcompat
¶
Compatibility functions for older versions of nibabel
Nibabel <= 1.3.0 do not have these attributes:
header
affine
dataobj
The equivalents for these older versions of nibabel are:
obj.get_header()
obj.get_affine()
obj._data
With old nibabel, getting unscaled data used read_img_data(img, prefer=”unscaled”). Newer nibabel should prefer the `get_unscaled method on the image proxy object
Functions¶
-
nipy.io.nibcompat.
get_affine
(img)[source]¶ Return affine from nibabel image
- Parameters
img :
SpatialImage
instanceInstance of nibabel
SpatialImage
class- Returns
affine : object
affine object from img
-
nipy.io.nibcompat.
get_dataobj
(img)[source]¶ Return data object for nibabel image
- Parameters
img :
SpatialImage
instanceInstance of nibabel
SpatialImage
class- Returns
dataobj : object
ArrayProxy
or ndarray object containing data for img