File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -59,11 +59,12 @@ def __init__(self, mincfile):
59
59
# We don't currently support irregular spacing
60
60
# https://en.wikibooks.org/wiki/MINC/Reference/MINC2.0_File_Format_Reference#Dimension_variable_attributes
61
61
for dim in self ._dims :
62
- if hasattr (dim , 'spacing' ):
63
- if dim .spacing == b'irregular' :
64
- raise ValueError ('Irregular spacing not supported' )
65
- elif dim .spacing != b'regular__' :
66
- warnings .warn (f'Invalid spacing declaration: { dim .spacing } ; assuming regular' )
62
+ # "If this attribute is absent, a value of regular__ should be assumed."
63
+ spacing = getattr (dim , 'spacing' , b'regular__' )
64
+ if spacing == b'irregular' :
65
+ raise ValueError ('Irregular spacing not supported' )
66
+ elif spacing != b'regular__' :
67
+ warnings .warn (f'Invalid spacing declaration: { spacing } ; assuming regular' )
67
68
68
69
self ._spatial_dims = [name for name in self ._dim_names if name .endswith ('space' )]
69
70
self ._image_max = image ['image-max' ]
You can’t perform that action at this time.
0 commit comments