[Insight-users] Composition of two versor transforms

Luis Ibanez luis.ibanez at kitware.com
Tue Dec 1 18:09:09 EST 2009


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
>
>
>


More information about the Insight-users mailing list