<div dir="ltr">Hi Tim<div>Thanks for your reply.</div><div>I have somewhat solve the pointset registration problem using <span style="font-size:12.8px">itkVersorRigid3DTransform. Now the rotation is working fine after applying </span><span style="font-weight:bold;color:rgb(106,106,106);line-height:18.2px">itk</span><span style="color:rgb(84,84,84);line-height:18.2px">::</span><span style="font-weight:bold;color:rgb(106,106,106);line-height:18.2px">TransformMeshFilter</span><span style="font-size:12.8px"> to the initial mesh. </span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">But I'm still unable to register those pointset using </span><span style="font-weight:bold;color:rgb(106,106,106);line-height:18.2px">itk</span><span style="color:rgb(84,84,84);line-height:18.2px">::</span><span style="font-weight:bold;color:rgb(106,106,106);line-height:18.2px">AffineTransform. </span><span style="color:rgb(106,106,106);line-height:18.2px">I need to scale the initial mesh. </span><span style="color:rgb(106,106,106);line-height:18.2px">Isn't it possible to apply affine transform to a pointset or mesh ? </span></div><div><span style="font-weight:bold;color:rgb(106,106,106);line-height:18.2px"><br></span></div><div><span style="color:rgb(106,106,106);line-height:18.2px">Thanks and Regards.</span></div><div><span style="color:rgb(106,106,106);line-height:18.2px">Sharmin</span><span style="font-weight:bold;color:rgb(106,106,106);line-height:18.2px"> </span></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 6, 2016 at 5:23 AM, Timothee Evain <span dir="ltr"><<a href="mailto:tevain@telecom-paristech.fr" target="_blank">tevain@telecom-paristech.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Sharmin,<br>
<br>
If your are able to know which point of dataset 1 correspond to each point of dataset 2 (e.g. the point [-1.158 -9.962 -7.944] should match the point [70.3771 16.9556 -77.8874] after registration), then your problem is the one of Absolute Orientation. You could find the exact rotation solving this problem.<br>
You could refer to the Horn method (<a href="http://people.csail.mit.edu/bkph/papers/Absolute_Orientation.pdf" rel="noreferrer" target="_blank">http://people.csail.mit.edu/bkph/papers/Absolute_Orientation.pdf</a>) or the paper of Besl and McKay which introduce the ICP (<a href="http://graphics.stanford.edu/courses/cs164-09-spring/Handouts/paper_icp.pdf" rel="noreferrer" target="_blank">http://graphics.stanford.edu/courses/cs164-09-spring/Handouts/paper_icp.pdf</a>) to know how to do it. They are using quaternion for the rotation, but you could retrieve the rotation matrix from it, hence the euler angles (if you know the sequence of rotation, ITK's one is Z->Y->X if I remember correctly). Or you could go with the itkVersorRigid3DTransform.<br>
<br>
If you're unable to know the correspondence, you could maybe do a PCA to find principal directions (at least 2) of each curve, take a point in each direction plus the centroid, and resolve the Absolute Orientation with them (you need at least 3 points). But I've never tried it.<br>
<br>
HTH,<br>
<br>
Tim<br>
<br>
<br>
<br>
----- Mail original -----<br>
De: "Sharmin Sultana" <<a href="mailto:ssult003@odu.edu">ssult003@odu.edu</a>><br>
À: <a href="mailto:insight-users@itk.org">insight-users@itk.org</a><br>
Envoyé: Samedi 4 Juin 2016 00:01:31<br>
Objet: [ITK] [ITK-users] Estimation of initial rotation for     Euler3DTransform<br>
<div><div class="h5"><br>
Dear all,<br>
<br>
I am trying to register two pointsets where each pointset represents a curve. I have tried using the IterativeClosestPointRegistration2.cxx example. But the problem with the results here is that while the translation seems to be OK, the rotation is not when I do not set an initial rotation.<br>
<br>
According to the user guide, the Euler3DTranform cannot handle for large rotations, and the user has to provide an initial rotation that is correct to within 10 or 20 degrees. When I have provided the initial rotations, and the resulting registered curve seems to be correct. I got the initial rotations by manually rotating and translating the moving pointset in Paraview against the fixed pointset using the Transform filter.<br>
<br>
Is there a way to automatically estimate the initial rotation required? Below are the pointsets that I was using.<br>
<br>
Fixed PointSet<br>
70.3771 16.9556 -77.8874<br>
69.2143 17.2079 -77.253<br>
68.1514 17.8068 -76.7957<br>
66.9762 18.1519 -76.4658<br>
65.8135 18.6132 -76.2163<br>
64.67 19.0656 -75.7242<br>
63.5119 19.2921 -75.3272<br>
62.3751 19.597 -75.0951<br>
61.2921 19.8394 -74.793<br>
60.2845 20.1405 -74.4514<br>
59.3191 20.3305 -74.1283<br>
58.408 20.3767 -73.9007<br>
57.5404 20.4277 -73.9293<br>
56.8618 20.7408 -73.5224<br>
55.4173 20.853 -72.9256<br>
54.7285 20.8667 -72.693<br>
53.6634 20.0938 -72.5906<br>
<br>
Moving PointSet:<br>
-1.158 -9.962 -7.944<br>
-1.026 -9.224 -7.430<br>
-0.883 -8.423 -6.872<br>
-0.757 -7.646 -6.300<br>
-0.640 -6.883 -5.727<br>
-0.518 -6.120 -5.179<br>
-0.406 -5.366 -4.622<br>
-0.352 -4.661 -4.000<br>
-0.291 -3.939 -3.394<br>
-0.185 -3.181 -2.817<br>
-0.042 -2.460 -2.183<br>
0.074 -1.710 -1.531<br>
0.174 -0.927 -0.853<br>
0.296 -0.109 -0.120<br>
0.459 0.737 0.693<br>
0.640 1.647 1.657<br>
0.861 2.763 2.808<br>
<br>
Thanks and regards,<br>
<br>
<br>
--<br>
Sharmin Sultana<br>
Old Dominion University<br>
<br>
</div></div>_____________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" 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" rel="noreferrer" 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.php" rel="noreferrer" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" rel="noreferrer" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/insight-users" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/insight-users</a><br>
<br>
_______________________________________________<br>
Community mailing list<br>
<a href="mailto:Community@itk.org">Community@itk.org</a><br>
<a href="http://public.kitware.com/mailman/listinfo/community" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/community</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><br></div>
</div></div>