Skip to content

Commit d71fc35

Browse files
committed
FIX: goodRASFlag check, update
1 parent 10e39cb commit d71fc35

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

nibabel/freesurfer/mghformat.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def __init__(self,
104104
super(MGHHeader, self).__init__(binaryblock=binaryblock,
105105
endianness=endianness,
106106
check=False)
107-
if int(self._structarr['goodRASFlag']) < 0:
107+
if int(self._structarr['goodRASFlag']) < 1:
108108
self._set_affine_default()
109109
if check:
110110
self.check_fix()
@@ -325,6 +325,7 @@ def default_structarr(klass, endianness=None):
325325
def _set_affine_default(self):
326326
''' If goodRASFlag is 0, return the default delta, Mdc and Pxyz_c
327327
'''
328+
self._structarr['goodRASFlag'] = 1
328329
self._structarr['delta'][:] = np.array([1, 1, 1])
329330
self._structarr['Mdc'][0][:] = np.array([-1, 0, 0]) # x_ras
330331
self._structarr['Mdc'][1][:] = np.array([0, 0, -1]) # y_ras

0 commit comments

Comments
 (0)