<div>Hello Steven,</div>
<div> </div>
<div>the 12 parameter set for affine transform is structure something like this. </div>
<div> </div>
<div>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.</div>
<div> </div>
<div>Can someone else please confirm this.</div>
<div> </div>
<div>regards,</div>
<div>Ashish.<br><br> </div>
<div><span class="gmail_quote">On 11/15/05, <b class="gmail_sendername">Steven Boyd</b> <<a href="mailto:skboyd@ucalgary.ca">skboyd@ucalgary.ca</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hello,<br><br>When using AffineTransformation, I am using the ::GetInverse() method,<br>but the calculated inverse is not what I expected.
<br><br>There are 12 parameters set:<br><br>0.11256 0 0<br>0 0.11256 0<br>0 0 0.11256<br>2.28336 0.57888 12.9605<br><br>And the result after using ::GetInverse() is:<br><br>1 0 0
<br>0 1 0<br>0 0 1<br>-2.28336 -0.57888 -12.9605<br><br>I think the results should be:<br><br> 8.8842 0 0<br> 0 8.8842 0<br> 0 0 8.8842<br>
-5.7143 -10.8571 -110.0<br><br>Have I made an error, or is there a problem with the affine transformation?<br><br>I'm using ITK 2.2.0, and below is a snippet of the code:<br><br>> typedef itk::AffineTransform<double> TransformType;
<br>> typedef TransformType::OutputPointType OutputPointType;<br>> typedef TransformType::InputPointType InputPointType;<br>> typedef TransformType::ParametersType ParametersType;<br>><br>> TransformType::Pointer transform = TransformType::New();
<br>> int n = transform->GetNumberOfParameters();<br>> ParametersType parameters(n);<br>><br>> double* params = CalculateAffineTransform3DParameters(m4x4);<br>> for (int i = 0; i < n; i++) {<br>
> parameters[i] = params[i];<br>> }<br>> transform->SetParameters(parameters);<br>> transform->GetInverse(transform);<br><br>Thanks for any tips.<br><br>Steve<br>_______________________________________________
<br>Insight-users mailing list<br><a href="mailto:Insight-users@itk.org">Insight-users@itk.org</a><br><a href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</a><br></blockquote>
</div><br><br clear="all"><br>-- <br>Ashish Poddar<br><<a href="http://ahpoddar.bizhat.com">http://ahpoddar.bizhat.com</a>><br>Its high time we standardize everything!