20
20
EQUALITY_TOL = 1e-5
21
21
22
22
23
- class SpatialReference ( object ) :
23
+ class SpatialReference :
24
24
"""Factory to create spatial references."""
25
25
26
26
@staticmethod
@@ -32,7 +32,7 @@ def factory(dataset):
32
32
return ImageGrid (dataset )
33
33
34
34
35
- class SampledSpatialData ( object ) :
35
+ class SampledSpatialData :
36
36
"""Represent sampled spatial data: regularly gridded (images) and surfaces."""
37
37
38
38
__slots__ = ['_ndim' , '_coords' , '_npoints' , '_shape' ]
@@ -194,7 +194,7 @@ def apply(self, spatialimage, reference=None,
194
194
spatialimage : `spatialimage`
195
195
The image object containing the data to be resampled in reference
196
196
space
197
- reference : spatial object
197
+ reference : spatial object, optional
198
198
The image, surface, or combination thereof containing the coordinates
199
199
of samples that will be sampled.
200
200
order : int, optional
@@ -226,7 +226,7 @@ def apply(self, spatialimage, reference=None,
226
226
_ref = self .reference if reference is None \
227
227
else SpatialReference .factory (reference )
228
228
229
- if isinstance (spatialimage , str ):
229
+ if isinstance (spatialimage , ( str , Path ) ):
230
230
spatialimage = load (spatialimage )
231
231
232
232
data = np .asanyarray (spatialimage .dataobj )
0 commit comments