[Insight-users] Inverse of Similarity3DTransform

Luis Ibanez luis.ibanez at kitware.com
Sun Sep 17 11:33:35 EDT 2006


Hi Cristoph,

The GetInverse method is not implemented in the Similarity3DTransform.


There has been some discussion on how to implement the inverse
operation in a consistent way across all the transform.


The GetInverse() method that is being called is the one of
the superclasses of the Similarity transform. That's not the
method that should be used here.


What you may want to do is to extract the three components of the
Similarity transform:

    1) Scale (a Scalar)
    2) Rotation (a Versor = Unit Quaternion)
    3) Translation (a Vector)

Invert them and then invert their sequence of application.

You get the values with:

      scale  = similarityTransform->GetScale();
      versor = similarityTransform->GetVersor();
      vector = similarityTransform->GetTranslation();

The inversion is computed as

      iscale = 1.0 / scale
      iversor = versor.GetConjugate();
      ivector = -vector;

with iscale and iversor you can compute the matrix as

      matrix = iversor.GetMatrix() * iscale

Then in order to revert the order of translation you do

      rivector = matrix * ivector;


If you take now these componets:


        { iscale, iversor, rivector }


and "Set" them in a Similarity transform, you will have
the inversse of the original similarity transform.


Please let us know if you  find any problem implementing
this method.


   Thanks



      Luis



=============================
Christoph Niedermayr wrote:
> Hi all!
> 
> ITK 2.6
> I'm trying to get the inverse of Similarity3DTransform's
> parameter set p. p is valid (has been computed by registration
> with Similarity3DTransform). I thought [1] should work,
> but GetInverse always returns false... both transforms are of
> course Similarity3DTransforms!
> 
> Any hints?
> 
> best regards,
> chris
> 
> [1]
> originalTransform->SetParameters(p);
> if(originalTransform->GetInverse(inverseTransform))
>   p = inverseTransform->GetParameters();
> else
>   cout<< "bad luck :("
> 	
>   
> 
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 
> 




More information about the Insight-users mailing list