[Insight-users] AffineTransformation

Steven Boyd skboyd at ucalgary.ca
Tue Nov 15 18:12:15 EST 2005


Hello,

When using AffineTransformation, I am using the ::GetInverse() method, 
but the calculated inverse is not what I expected.

There are 12 parameters set:

0.11256   0        0
0         0.11256  0
0         0        0.11256
2.28336   0.57888  12.9605

And the result after using ::GetInverse() is:

1         0        0
0         1        0
0         0        1
-2.28336 -0.57888 -12.9605

I think the results should be:

    8.8842         0         0
         0    8.8842         0
         0         0    8.8842
   -5.7143  -10.8571    -110.0

Have I made an error, or is there a problem with the affine transformation?

I'm using ITK 2.2.0, and below is a snippet of the code:

>   typedef itk::AffineTransform<double> TransformType;
>   typedef TransformType::OutputPointType OutputPointType;
>   typedef TransformType::InputPointType InputPointType;
>   typedef TransformType::ParametersType ParametersType;
> 
>   TransformType::Pointer transform = TransformType::New();
>   int n = transform->GetNumberOfParameters();
>   ParametersType parameters(n);
> 
>   double* params = CalculateAffineTransform3DParameters(m4x4);
>   for (int i = 0; i < n; i++) {
>     parameters[i] = params[i];
>   }
>   transform->SetParameters(parameters);
>   transform->GetInverse(transform);

Thanks for any tips.

Steve


More information about the Insight-users mailing list