Skip to content

Commit 3fbae61

Browse files
oestebanmgxd
andauthored
Apply suggestions from code review
Co-Authored-By: Mathias Goncalves <[email protected]>
1 parent 325ef05 commit 3fbae61

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

nitransforms/base.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
EQUALITY_TOL = 1e-5
2121

2222

23-
class SpatialReference(object):
23+
class SpatialReference:
2424
"""Factory to create spatial references."""
2525

2626
@staticmethod
@@ -32,7 +32,7 @@ def factory(dataset):
3232
return ImageGrid(dataset)
3333

3434

35-
class SampledSpatialData(object):
35+
class SampledSpatialData:
3636
"""Represent sampled spatial data: regularly gridded (images) and surfaces."""
3737

3838
__slots__ = ['_ndim', '_coords', '_npoints', '_shape']
@@ -194,7 +194,7 @@ def apply(self, spatialimage, reference=None,
194194
spatialimage : `spatialimage`
195195
The image object containing the data to be resampled in reference
196196
space
197-
reference : spatial object
197+
reference : spatial object, optional
198198
The image, surface, or combination thereof containing the coordinates
199199
of samples that will be sampled.
200200
order : int, optional
@@ -226,7 +226,7 @@ def apply(self, spatialimage, reference=None,
226226
_ref = self.reference if reference is None \
227227
else SpatialReference.factory(reference)
228228

229-
if isinstance(spatialimage, str):
229+
if isinstance(spatialimage, (str, Path)):
230230
spatialimage = load(spatialimage)
231231

232232
data = np.asanyarray(spatialimage.dataobj)

0 commit comments

Comments
 (0)