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