|
46 | 46 | # caveat 2: Note that the bytespervox you get is in str ( not an int)
|
47 | 47 | _dtdefs = ( # code, conversion function, dtype, bytes per voxel
|
48 | 48 | (0, 'uint8', '>u1', '1', 'MRI_UCHAR', np.uint8, np.dtype(np.uint8),
|
49 |
| - np.dtype(np.uint8).newbyteorder('B')), |
| 49 | + np.dtype(np.uint8).newbyteorder('>')), |
50 | 50 | (4, 'int16', '>i2', '2', 'MRI_SHORT', np.int16, np.dtype(np.int16),
|
51 |
| - np.dtype(np.int16).newbyteorder('B')), |
| 51 | + np.dtype(np.int16).newbyteorder('>')), |
52 | 52 | (1, 'int32', '>i4', '4', 'MRI_INT', np.int32, np.dtype(np.int32),
|
53 |
| - np.dtype(np.int32).newbyteorder('B')), |
| 53 | + np.dtype(np.int32).newbyteorder('>')), |
54 | 54 | (3, 'float', '>f4', '4', 'MRI_FLOAT', np.float32, np.dtype(np.float32),
|
55 |
| - np.dtype(np.float32).newbyteorder('B'))) |
| 55 | + np.dtype(np.float32).newbyteorder('>'))) |
56 | 56 |
|
57 | 57 | # make full code alias bank, including dtype column
|
58 | 58 | data_type_codes = Recoder(_dtdefs, fields=('code', 'label', 'dtype',
|
59 | 59 | 'bytespervox', 'mritype',
|
| 60 | + 'np_dtype1', 'np_dtype2', |
60 | 61 | 'numpy_dtype'))
|
61 | 62 |
|
62 | 63 |
|
@@ -274,7 +275,7 @@ def set_zooms(self, zooms):
|
274 | 275 | '''
|
275 | 276 | hdr = self._header_data
|
276 | 277 | zooms = np.asarray(zooms)
|
277 |
| - if len(zooms) != hdr['delta']: |
| 278 | + if len(zooms) != len(hdr['delta']): |
278 | 279 | raise HeaderDataError('Expecting %d zoom values for ndim'
|
279 | 280 | % hdr['delta'])
|
280 | 281 | if np.any(zooms < 0):
|
|
0 commit comments