[Insight-users] AffineTransformation
Ashish Poddar
ahpoddar at gmail.com
Wed Nov 16 14:49:33 EST 2005
Hello Steven,
the 12 parameter set for affine transform is structure something like this.
9 parameters represent the rotation + shear + scaling, and last three
represent translation. so when taking the inverse, the translation should be
just negated which is what u are seeing. In the initial 9 parameters the
matrix you have send represents no rotation, no shearing, and isoscaling by
a factor of 0.11256. I am not very sure but if the affine transformation
retains a separate factor for scaling, then that can take care of this
factor leaving behind a unit matrix whose inverse will be the same.
Can someone else please confirm this.
regards,
Ashish.
On 11/15/05, Steven Boyd <skboyd at ucalgary.ca> wrote:
>
> 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
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>
--
Ashish Poddar
<http://ahpoddar.bizhat.com>
Its high time we standardize everything!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20051116/8745f72d/attachment.htm
More information about the Insight-users
mailing list