Notes |
|
(0008874)
|
Luis Ibanez
|
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
|
2007-09-06 19:14
|
|
|
|
(0008876)
|
Luis Ibanez
|
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
|
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
|
2008-01-23 15:21
|
|
Andinet will add a test to verify that the fix it is working. |
|
|
(0010250)
|
Luis Ibanez
|
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
|
2010-10-21 13:09
|
|
|