Hello, <div><br></div><div> I am calculating the inverse of an affine transform using the GetInverse() Method. The transformation has a non-zero center of rotation. After the inverse, I am getting a center of rotation that is reset to the origin. Is this the expected behavior? Is there a way to force the inverse to have the same center of rotation?</div>
<div><br></div><div><br><div>Here is the code:</div></div><div><div><br></div><div>typedef itk::AffineTransform< double, 2 > TransformType;</div><div>TransformType::Pointer transform = TransformType::New();</div>
<div>TransformType::ParametersType affParameters(transform->GetNumberOfParameters());</div><div>for(int i=0;i<6;i++)</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>affParameters[i] = transParameters[i];</div>
<div>transform->SetParameters(affParameters);</div><div>double center[2];</div><div>center[0] = transParameters[6];</div><div>center[1] = transParameters[7];</div><div>transform->SetCenter(center);</div><div><br></div>
<div>TransformType::Pointer inverse = TransformType::New();</div><div>transform->GetInverse(inverse);</div><div>TransformType::ParametersType inverseParameters = inverse->GetParameters();</div><div><br></div><div>inverseTransParamters[0] = inverseParameters[0];</div>
<div>inverseTransParamters[1] = inverseParameters[1];</div><div>inverseTransParamters[2] = inverseParameters[2];</div><div>inverseTransParamters[3] = inverseParameters[3];</div><div>inverseTransParamters[4] = inverseParameters[4];</div>
<div>inverseTransParamters[5] = inverseParameters[5];</div><div><br></div><div>inverseTransParamters[6] = inverse->GetCenter()[0];</div><div>inverseTransParamters[7] = inverse->GetCenter()[1];</div></div><div><br></div>
<div>Thanks,</div><div>John</div>