|
37 | 37 |
|
38 | 38 | from .. import (AnalyzeImage, Spm99AnalyzeImage, Spm2AnalyzeImage, |
39 | 39 | Nifti1Pair, Nifti1Image, Nifti2Pair, Nifti2Image, |
40 | | - MGHImage, Minc1Image, Minc2Image) |
| 40 | + MGHImage, Minc1Image, Minc2Image, is_proxy) |
41 | 41 | from ..spatialimages import SpatialImage |
42 | 42 | from .. import minc1, minc2, parrec |
43 | 43 |
|
44 | 44 | from nose import SkipTest |
45 | | -from nose.tools import (assert_true, assert_false, assert_raises, |
46 | | - assert_equal, assert_not_equal) |
| 45 | +from nose.tools import (assert_true, assert_false, assert_raises, assert_equal) |
47 | 46 |
|
48 | 47 | from numpy.testing import (assert_almost_equal, assert_array_equal) |
49 | 48 | from ..testing import clear_and_catch_warnings |
@@ -203,8 +202,13 @@ def validate_data_interface(self, imaker, params): |
203 | 202 | assert_data_similar(img.dataobj, params) |
204 | 203 | for meth_name in ('get_fdata', 'get_data'): |
205 | 204 | if params['is_proxy']: |
| 205 | + # Parameters assert this is an array proxy |
206 | 206 | img = imaker() |
| 207 | + # Does is_proxy agree? |
| 208 | + assert_true(is_proxy(img.dataobj)) |
| 209 | + # Confirm it is not a numpy array |
207 | 210 | assert_false(isinstance(img.dataobj, np.ndarray)) |
| 211 | + # Confirm it can be converted to a numpy array with is_array |
208 | 212 | proxy_data = np.asarray(img.dataobj) |
209 | 213 | proxy_copy = proxy_data.copy() |
210 | 214 | # Not yet cached, proxy image: in_memory is False |
|
0 commit comments