View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005665ITKpublic2007-09-06 18:432010-10-21 13:09
ReporterLuis Ibanez 
Assigned ToAndinet 
PriorityhighSeveritymajorReproducibilityhave not tried
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0005665: Similarity3DTransform bug in SetMatrix () and ComputeMatrixParameters()
DescriptionUsing only two terms of the matrix for computing the scale
Additional InformationReported in the users list by
http://public.kitware.com/pipermail/insight-users/2007-September/023560.html [^]
TagsNo tags attached.
Resolution Date
Sprint
Sprint Statusbacklog
Attached Files

 Relationships

  Notes
(0008874)
Luis Ibanez (manager)
2007-09-06 18:46
edited on: 2007-09-06 18:52

The Isotropic scaling of the matrix is being computed as

 double s = vnl_math_sqr( matrix[0][0] ) +
            vnl_math_sqr( matrix[0][1] );

Which doesn't take into account the 3D nature of the Transform.

Since the Matrix is expected to be an Orthogonal matrix multiplied by an isotropic scaling, the scaling value can be recovered as:

A) The trace of the matrix divided by the dimension (3 in this case)
B) The cubic root of the matrix determinant

(0008875)
Luis Ibanez (manager)
2007-09-06 19:14

A fix has been committed to the CVS repository:
http://www.itk.org/cgi-bin/viewcvs.cgi/Code/Common/itkSimilarity3DTransform.txx?root=Insight&sortby=date&r2=1.8&r1=1.7 [^]
(0008876)
Luis Ibanez (manager)
2007-09-06 19:15

The cubic root of the determinant turned out to be a more precise way of computing the scale than taking the trace divided by three.
(0008878)
Luis Ibanez (manager)
2007-09-07 08:24
edited on: 2007-09-07 08:26

The rationale is the the Similarity3D Transform
has a matrix composed of:


      | M00 M01 M02 |
      | M10 M11 M12 | =
      | M20 M21 M22 |

            | S 0 0 | | T00 T01 T02 |
            | 0 S 0 | | T10 T11 T12 |
            | 0 0 S | | T20 T21 T22 |

Where [T] is an orthogonal Matrix, and S is the Scaling
factor. The determinant of the resulting matrix M is
equal to

           Det([M]) = S^3 * Det([T])

and [T] being Orthogonal, should have a unit determinant.

Therefore:

           S = CubeRoot( Det([M] )

(0010249)
Luis Ibanez (manager)
2008-01-23 15:21

Andinet will add a test to verify that the fix it is working.
(0010250)
Luis Ibanez (manager)
2008-01-23 15:23
edited on: 2008-01-23 15:24

The test should do: (pseudocode)

TransformType t1;
t1.SetScale( value );

TransformType t2;

t2.SetMatrix( t1.GetMatrix() );

t2.ComputeMatrixParameters();

if( t1.GetScale() != t2.GetScale() )
{
   return EXIT_FAILURE;
}

(0022620)
Hans Johnson (developer)
2010-10-21 13:09

Assumed fixed.

 Issue History
Date Modified Username Field Change
2007-09-06 18:43 Luis Ibanez New Issue
2007-09-06 18:46 Luis Ibanez Note Added: 0008874
2007-09-06 18:52 Luis Ibanez Note Edited: 0008874
2007-09-06 19:14 Luis Ibanez Note Added: 0008875
2007-09-06 19:15 Luis Ibanez Note Added: 0008876
2007-09-07 08:24 Luis Ibanez Note Added: 0008878
2007-09-07 08:24 Luis Ibanez Note Edited: 0008878
2007-09-07 08:25 Luis Ibanez Note Edited: 0008878
2007-09-07 08:26 Luis Ibanez Note Edited: 0008878
2008-01-23 15:21 Luis Ibanez Note Added: 0010249
2008-01-23 15:21 Luis Ibanez Status new => assigned
2008-01-23 15:21 Luis Ibanez Assigned To => Andinet
2008-01-23 15:23 Luis Ibanez Note Added: 0010250
2008-01-23 15:24 Luis Ibanez Note Edited: 0010250
2010-10-21 13:09 Hans Johnson Sprint Status => backlog
2010-10-21 13:09 Hans Johnson Note Added: 0022620
2010-10-21 13:09 Hans Johnson Status assigned => closed
2010-10-21 13:09 Hans Johnson Resolution open => fixed


Copyright © 2000 - 2018 MantisBT Team