@@ -101,33 +101,33 @@ to change silently between nibabel versions.
101101
102102* step 1: now - add ``get_fdata `` method:
103103
104- .. code :: python
105-
106- def get_fdata (self , dtype = np.float64):
107- """ Return floating point image data with necessary scalng applied.
108-
109- If the image data is an array proxy (data not yet read from disk) then
110- read the data from file, and retain the result in an internal cache.
111- Future calls to ``get_fdata`` on the same image instance will return
112- the cached copy.
113-
114- Parameters
115- ----------
116- dtype : numpy dtype specifier
117- A numpy dtype specifier specifying a floating point type. Data is
118- returned as this floating point type. Default is ``np.float64``.
119-
120- Returns
121- -------
122- fdata : array
123- Array of image data of data type `dtype`.
124- """
125- dtype = np.dtype(dtype)
126- if not issubclass (dtype, np.inexact):
127- raise ValueError (' {} should be floating point type' .format(dtype))
128- if self ._fdata_cache is None :
129- self ._fdata_cache = np.asanyarray(self ._dataobj).astype(dtype)
130- return self ._fdata_cache
104+ .. code :: python
105+
106+ def get_fdata (self , dtype = np.float64):
107+ """ Return floating point image data with necessary scalng applied.
108+
109+ If the image data is an array proxy (data not yet read from disk) then
110+ read the data from file, and retain the result in an internal cache.
111+ Future calls to ``get_fdata`` on the same image instance will return
112+ the cached copy.
113+
114+ Parameters
115+ ----------
116+ dtype : numpy dtype specifier
117+ A numpy dtype specifier specifying a floating point type. Data is
118+ returned as this floating point type. Default is ``np.float64``.
119+
120+ Returns
121+ -------
122+ fdata : array
123+ Array of image data of data type `dtype`.
124+ """
125+ dtype = np.dtype(dtype)
126+ if not issubclass (dtype, np.inexact):
127+ raise ValueError (' {} should be floating point type' .format(dtype))
128+ if self ._fdata_cache is None :
129+ self ._fdata_cache = np.asanyarray(self ._dataobj).astype(dtype)
130+ return self ._fdata_cache
131131
132132 Change all instances of ``get_data `` in documentation to ``get_fdata ``.
133133
0 commit comments