MantisBT - ITK
View Issue Details
0008312ITKpublic2008-12-17 23:272009-03-10 20:02
Hans Johnson 
Hans Johnson 
normalminoralways
closedfixed 
ITK-3-10 
ITK-3-10 
0008312: Orthogonal Matrix to Versor conversion singularities
Versor has a Set method from an Rotation matrix. The code for managing singularities around the "north" and "south" poles i.e. for rotation angles around pi were not properly being processed.
The epsilon used for determining when to use the alternate computation around the singularities near rotation angles near pi was set at 1e-30. The meant that the standard computation was used for rotation matrix trace values greater than 1e-30, but computation was not stable at that level.

It makes more sense to set the epsilon to vcl_numeric_limits<T>, which for double precision floats provides accuracy near rotations of pi at resolutions smaller than 1/10000 of a degree.

New set of tests created to verify that very similar results are achieved for taking converting rotation matrices to versors and back again that produce the correct results.
No tags attached.
Issue History
2008-12-17 23:27Hans JohnsonNew Issue
2008-12-17 23:30Hans JohnsonNote Added: 0014390
2008-12-17 23:40Hans JohnsonNote Added: 0014391
2009-02-07 16:46Hans JohnsonNote Added: 0014826
2009-02-07 16:46Hans JohnsonStatusnew => resolved
2009-02-07 16:46Hans JohnsonFixed in Version => ITK-3-10
2009-02-07 16:46Hans JohnsonResolutionopen => fixed
2009-02-07 16:46Hans JohnsonAssigned To => Hans Johnson
2009-03-10 20:02Hans JohnsonNote Added: 0015631
2009-03-10 20:02Hans JohnsonStatusresolved => closed

Notes
(0014390)
Hans Johnson   
2008-12-17 23:30   
I believe that the itkVersorTransform and itkVersor3DTransform could have the SetRotationMatrix functions moved from private to public again with this change.

It is my belief that they were made protected because of the numeric instability caused by the exceptionally low tolerance for dealing with the tolerances properly. The new test cases show that with a high degree of confidence one can convert between the two rotation representations with very little loss of accuracy.
(0014391)
Hans Johnson   
2008-12-17 23:40   
Test and changes added:

/cvsroot/Insight/Insight/Code/Common/itkVersor.txx,v <-- Code/Common/itkVersor.txx
new revision: 1.29; previous revision: 1.28
/cvsroot/Insight/Insight/Testing/Code/Common/itkVersorTest.cxx,v <-- Testing/Code/Common/itkVersorTest.cxx
new revision: 1.20; previous revision: 1.19
(0014826)
Hans Johnson   
2009-02-07 16:46   
Test cases and code fixes have been added.
(0015631)
Hans Johnson   
2009-03-10 20:02   
This has been fixed.