Skip to content

Commit addb6ad

Browse files
committed
RF: Specify spatial dims in each class
1 parent afefa49 commit addb6ad

File tree

5 files changed

+5
-3
lines changed

5 files changed

+5
-3
lines changed

nibabel/analyze.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -911,6 +911,7 @@ class AnalyzeImage(SpatialImage):
911911
files_types = (('image', '.img'), ('header', '.hdr'))
912912
valid_exts = ('.img', '.hdr')
913913
_compressed_suffixes = ('.gz', '.bz2')
914+
_spatial_dims = slice(0, 3)
914915

915916
makeable = True
916917
rw = True

nibabel/ecat.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,7 @@ class EcatImage(SpatialImage):
740740
valid_exts = ('.v',)
741741
_subheader = EcatSubHeader
742742
files_types = (('image', '.v'), ('header', '.v'))
743+
_spatial_dims = slice(0, 3)
743744

744745
ImageArrayProxy = EcatImageArrayProxy
745746

nibabel/freesurfer/mghformat.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,7 @@ class MGHImage(SpatialImage):
507507
ImageOpener.compress_ext_map['.mgz'] = ImageOpener.gz_def
508508
files_types = (('image', '.mgh'),)
509509
_compressed_suffixes = ()
510+
_spatial_dims = slice(0, 3)
510511

511512
makeable = True
512513
rw = True

nibabel/parrec.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,6 +1222,7 @@ class PARRECImage(SpatialImage):
12221222
header_class = PARRECHeader
12231223
valid_exts = ('.rec', '.par')
12241224
files_types = (('image', '.rec'), ('header', '.par'))
1225+
_spatial_dims = slice(0, 3)
12251226

12261227
makeable = False
12271228
rw = False

nibabel/spatialimages.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,9 +325,7 @@ class ImageDataError(Exception):
325325
class SpatialImage(DataobjImage):
326326
''' Template class for volumetric (3D/4D) images '''
327327
header_class = SpatialHeader
328-
# Make a strong assumption that the first three dimensions are spatial
329-
# Subclasses/images for which this is not true should change this attribute
330-
_spatial_dims = slice(0, 3)
328+
_spatial_dims = None
331329

332330
class Slicer(object):
333331
''' Slicing interface that returns a new image with an updated affine

0 commit comments

Comments
 (0)