Skip to content

Commit 1c4ac28

Browse files
author
Robert D. Vincent
committed
BF: never more dimension names than the variable actually has. It is possible (though incorrect) that the dimorder can be set on a scalar image-min, e.g. This fix avoids triggering an error on these (arguably malformed) files.
1 parent ec4567f commit 1c4ac28

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

nibabel/minc2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def _get_dimensions(self, var):
7777
dimorder = var.attrs['dimorder'].decode()
7878
except KeyError: # No specified dimensions
7979
return []
80-
return dimorder.split(',')
80+
return dimorder.split(',')[:len(var.shape)]
8181

8282
def get_data_dtype(self):
8383
return self._image.dtype

0 commit comments

Comments
 (0)