[Insight-users] Composition of two versor transforms

Patrik Brynolfsson patrik.brynolfsson at gmail.com
Wed Dec 2 05:30:07 EST 2009


Ok, thank you for your explanations, I see that it's not as easy as I hoped
it to be.

I don't have very much experience in C++ programming, so I don't think I can
contribute very much in a new method. I use MATLAB alot, and call ITK when
heavy computations are needed. I implemented a short ITK script that returns
the composite versor using the rotation matrix and translation vector, and
it works just fine so thank you very much for your help and insight!

Regards Patrik

2009/12/2 Luis Ibanez <luis.ibanez at kitware.com>

> Hi Patrik,
>
> I'm afraid that even if you avoid the Matrices, the combination
> of two Versor transforms is still going to be a bit complicated.
>
>  You can rewrite the transformation:
>
>               P' = M x P + T
> as
>              P' = V * P + T
>
> by using "*" as the composition operator for the Versor "V",
> and still the full conversion will be of the type:
>
>     P" = V2 * ( P' - C2 ) + T2 + C2
>      P" = V2 * ( V1 * ( P - C1)  + T1 + C1 ) + T2 + C2
>
> and in practice, the implementation of the operator "*"
> between Versor and Point ends up being very close
> to a Matrix multiplication (actually a bit more expensive
> since the intermediate computations are not reused)
>
> Probably the best way to go is to add to the VersorTransform
> class a "Composition()" method, and we pack all this math
> above inside. We have similar methods for the Affine Transform.
>
>
> Would you like to give it a first try ?
>
>
>     Luis
>
>
>
> -------------------------------------------------------
> On Fri, Nov 27, 2009 at 7:23 AM, Patrik Brynolfsson
> <patrik.brynolfsson at gmail.com> wrote:
> > Hello Luis,
> > Thanks for the answer and sorry for the double post, I had some problems
> > with my mail account.
> > I'm using "versorRigid3DTransform", and from what I've gathered all i
> need
> > is to save the versor (1x6) and center of rotation (1x3) to perform the
> same
> > transform again. A while back I tried to extract the rotation matrix and
> use
> > that with the versorRigid3DTransform but from what I recall that was not
> > allowed. Perhaps I misremember. Anyway was wondering if there is a way to
> > only use the versors and center of rotation to combine the two
> transforms,
> > without the extra step of dealing with matrices?
> > Thanks for the detailed explanation in your answer!
> > Regards, Patrik
> >
> > 2009/11/26 Luis Ibanez <luis.ibanez at kitware.com>
> >>
> >> Hi Patrik,
> >>
> >> Each Versor Transform does the equivalent of:
> >>
> >>                     P'  = Transform(P) = M x P + T
> >>
> >> Where M is a rotation matrix computed from the Versor parameters,
> >> and T is the Translation vector.
> >>
> >> to be more precise,
> >> this Transform also has a Center of rotation "C",
> >> so the actual computation is:
> >>
> >>    P' = Transform(P) = M x ( P - C ) + T + C
> >>
> >> Now, when you compose two Versor Transforms you should do:
> >>
> >>   P" = Transform2( P' ) = Transform2( Transform1( P ) )
> >>
> >> This leads to:
> >>
> >>  P" = M2 x ( P' - C2 ) + T2 + C2
> >>  P" = M2 x ( M1 x ( P - C1 ) + T1 + C1  - C2 ) + T2 + C2
> >>
> >> which leads to
> >>
> >>  P" =  M2 x M1 x ( P - C1 )  + M2x(T1+C1-C2)  + (T2+C2)
> >>
> >> You can get the matrix M from each transform by calling the
> >> method: GetMatrix(); the translation by calling GetTranslation();
> >> and the center C by calling the method GetCenter().
> >>
> >>
> >>
> >>    Regards,
> >>
> >>
> >>         Luis
> >>
> >>
> >> --------------------------------------------------------
> >> On Thu, Nov 26, 2009 at 4:05 AM, Patrik Brynolfsson
> >> <patrik.brynolfsson at gmail.com> wrote:
> >> > Hello everyone,
> >> > I have a question I hope someone can clarify for me. I want to combine
> >> > the
> >> > result from two versor transforms. From what I've gathered I shouldn't
> >> > add
> >> > the elements of the two, but how then? Can someone please explain?
> >> > Thanks in advance!
> >> > --
> >> > Patrik Brynolfsson
> >> >
> >> >
> >> > _____________________________________
> >> > Powered by www.kitware.com
> >> >
> >> > Visit other Kitware open-source projects at
> >> > http://www.kitware.com/opensource/opensource.html
> >> >
> >> > Kitware offers ITK Training Courses, for more information visit:
> >> > http://www.kitware.com/products/protraining.html
> >> >
> >> > Please keep messages on-topic and check the ITK FAQ at:
> >> > http://www.itk.org/Wiki/ITK_FAQ
> >> >
> >> > Follow this link to subscribe/unsubscribe:
> >> > http://www.itk.org/mailman/listinfo/insight-users
> >> >
> >> >
> >
> >
> >
> > --
> > Patrik Brynolfsson
> >
> >
> >
>



-- 
Patrik Brynolfsson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20091202/c4a61a98/attachment.htm>


More information about the Insight-users mailing list