You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a data set where the slice normal in the Siemens CSA header is not quite orthogonal to the directions in the "ImageOrientationPatient". This causes the assertion on line 165 in nibabel.nicom.dicomwrappers to fail.
>>> from nibabel.nicom.dicomwrappers import wrapper_from_data
>>> dcm_wrp = wrapper_from_data(dcm)
>>> dcm_wrp.rotation_matrix
---------------------------------------------------------------------------
AssertionError Traceback (most recent call last)
/home/moloney/<ipython-input-13-3a0219ff8c80> in <module>()
----> 1 dcm_wrp.rotation_matrix
/usr/global/lib/python2.7/site-packages/nibabel-1.2.0-py2.7.egg/nibabel/onetime.pyc in __get__(self, obj, type)
41 return self.getter
42
---> 43 val = self.getter(obj)
44 #print "** setattr_on_read - loading '%s'" % self.name # dbg
45 setattr(obj, self.name, val)
/usr/global/lib/python2.7/site-packages/nibabel-1.2.0-py2.7.egg/nibabel/nicom/dicomwrappers.pyc in rotation_matrix(self)
163 assert np.allclose(np.eye(3),
164 np.dot(R, R.T),
--> 165 atol=1e-6)
166 return R
167
AssertionError:
>>> dcm_wrp.slice_normal
array([ 0. , 0.43994078, 0.89802679])
>>> iop = dcm_wrp.image_orient_patient
>>> iop = np.array([float(x) for col in iop for x in col]).reshape(iop.shape)
>>> np.cross(*iop.T[:]) - dcm_wrp.slice_normal
array([ 4.39939181e-17, -1.59949810e-06, 7.80545210e-07])
The text was updated successfully, but these errors were encountered:
moloney
added a commit
to moloney/nibabel
that referenced
this issue
Jul 13, 2012
I have a data set where the slice normal in the Siemens CSA header is not quite orthogonal to the directions in the "ImageOrientationPatient". This causes the assertion on line 165 in nibabel.nicom.dicomwrappers to fail.
The text was updated successfully, but these errors were encountered: