Permalink
Browse files

fix broken computation of orientation from qform in nifti_sa

  • Loading branch information...
1 parent e8b71b4 commit b53dd5e996f3b508f2a3abaa321acda19c7ed403 @DerOrfa DerOrfa committed Feb 9, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/ImageIO/imageFormat_nifti_sa.cpp
@@ -832,7 +832,7 @@ void ImageFormat_NiftiSa::useQForm( util::PropertyMap &props )
double &a = quaternion[0], &b = quaternion[1], &c = quaternion[2], &d = quaternion[3];
- if( 1 - quaternion.sqlen() ) { //if the quaternion is to "long"
+ if( 1 - quaternion.sqlen() < 1.e-7) { //if the quaternion is to "long"
quaternion.norm(); //normalize it and leave the angle as 0
} else {
a = sqrt( 1 - quaternion.sqlen() ); /* angle = 2*arccos(a) */

0 comments on commit b53dd5e

Please sign in to comment.