<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Hi Matias,</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">translation (called offset in some of the classes) and center of rotation are different things, and taken care of differently.</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Regards,</div><div class="gmail_default"><font face="verdana, sans-serif">Dženan Zukić, PhD, Senior R&D Engineer, Kitware (Carrboro, N.C.)</font></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 19, 2017 at 1:30 PM, Francois Budin <span dir="ltr"><<a href="mailto:francois.budin@kitware.com" target="_blank">francois.budin@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Hello Matias,<br><br></div>I created a small executable based on the code you sent me:<br><br>#include <itkEuler3DTransform.h><span class=""><br><br>int main(int argc, char* argv[])<br>{<br></span><span class="">  typedef itk::Euler3DTransform< double > TransformType; <br>//Transform<br>  TransformType::Pointer transform = TransformType::New(); <br>double alfa, beta, gamma, centro_rotacion_X, centro_rotacion_Y, centro_rotacion_Z, origenX,origenY; <br>gamma = atof(argv[2]); <br>beta = atof(argv[3]); <br>alfa = atof(argv[4]); <br>centro_rotacion_X = atof(argv[5]); <br>centro_rotacion_Y = atof(argv[6]); <br>centro_rotacion_Z = atof(argv[7]); <br>double centro[3] = { centro_rotacion_X, centro_rotacion_Y, centro_rotacion_Z }; <br>transform->SetCenter(centro); <br>transform->SetRotation(gamma, beta, alfa); <br></span>std::cout<<transform-><wbr>GetCenter()<<std::endl;<br>std::cout<<transform-><wbr>GetMatrix()<<std::endl;<br>std::cout<<transform<<std::<wbr>endl;<br>  return 0;<br>}<br><br></div>And the results are correct:<br>./Euler 10 20 30 40 50 60 70<br>[50, 60, 70]<br>0.56923 -0.304067 0.763885<br>0.716525 -0.272165 -0.642275<br>0.403198 0.912945 0.0629472<br><br>Euler3DTransform (0x1126e80)<span class=""><br>  RTTI typeinfo:   itk::Euler3DTransform<double><br></span>  Reference Count: 2<br>  Modified Time: 3<span class=""><br>  Debug: Off<br>  Object Name: <br>  Observers: <br>    none<br>  Matrix: <br></span>    0.56923 -0.304067 0.763885 <br>    0.716525 -0.272165 -0.642275 <br>    0.403198 0.912945 0.0629472 <br>  Offset: [-13.6894, 85.4629, -9.34292]<br>  Center: [50, 60, 70]<span class=""><br>  Translation: [0, 0, 0]<br>  Inverse: <br></span>    0.56923 0.716525 0.403198 <br>    -0.304067 -0.272165 0.912945 <br>    0.763885 -0.642275 0.0629472 <br>  Singular: 0<br>  Euler's angles: AngleX=20 AngleY=30 AngleZ=40<br>  m_ComputeZYX = 0<br><br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 19, 2017 at 11:56 AM, Matias <span dir="ltr"><<a href="mailto:matimontg@gmail.com" target="_blank">matimontg@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thanks Francois,<div><br></div><div>There's something strange in the matrix and Offset, this is what I get:</div><div><br></div><div><div>Center:</div><div><br></div><div>[-246.422, -149.871, 20]</div><div><br></div><div>Matrix:</div><div>1 0 0</div><div>0 1 0</div><div>0 0 1</div><div><br></div><div>Offset:</div><div>[0, 0, 0]</div></div></div><br><div class="gmail_quote"><div><div class="m_3321816680450957495h5"><div dir="ltr">El mar., 18 de abr. de 2017 a la(s) 14:47, Francois Budin-3 [via ITK - Users] <<a href="http:///user/SendEmail.jtp?type=node&node=38131&i=0" rel="nofollow" link="external" target="_blank">[hidden email]</a>> escribió:<br></div></div></div><blockquote style="border-left:2px solid #cccccc;padding:0 1em" class="gmail_quote"><div><div class="m_3321816680450957495h5">

        <div dir="ltr"><div><div><div><div>Hello Matias,<br><br></div>I used the Euler3DTransform in a python terminal to see if I had problems setting the center and the angle, and everything seems to work as expected:<br><br>trans=itk.Euler3DTransform.D.N<wbr>ew()<br>trans.SetCenter([0,0,0])<br></div>trans.SetRotation(10,0,0)<br></div>trans.TransformPoint([0,0,0])<br>Out[46]: itkPointD3 ([0, 0, 0])  <-expected as the transform center is [0,0,0]<br><br>trans.SetCenter([10,0,0])<br>trans.TransformPoint([0,0,0])<br>Out[48]: itkPointD3 ([5.16482, -7.96596, 3.62828]) <-rotation not around [0,0,0] but around [10,0,0]<br><br></div>To try to understand you problem, I would advise you to print the content of your transform to see if it is set as you expect. In my case, I get:<br><br><div>Euler3DTransform (0x18da8a0)<br>  RTTI typeinfo:   itk::Euler3DTransform<double><br>  Reference Count: 1<br>  Modified Time: 377<br>  Debug: Off<br>  Object Name: <br>  Observers: <br>    none<br>  Matrix: <br>    0.483518 -0.362828 0.796596 <br>    0.796596 0.559609 -0.228631 <br>    -0.362828 0.745113 0.559609 <br>  Offset: [5.16482, -7.96596, 3.62828]<br>  Center: [10, 0, 0]<br>  Translation: [0, 0, 0]<br>  Inverse: <br>    0.483518 0.796596 -0.362828 <br>    -0.362828 0.559609 0.745113 <br>    0.796596 -0.228631 0.559609 <br>  Singular: 0<br>  Euler's angles: AngleX=40 AngleY=10 AngleZ=10<br>  m_ComputeZYX = 0<br><br></div><div>Hope this helps,<br></div><div>Francois<br></div><div><br><br></div></div></div></div><div><div class="m_3321816680450957495h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 17, 2017 at 7:11 PM, Matias <span dir="ltr"><<a href="http:///user/SendEmail.jtp?type=node&node=38127&i=0" rel="nofollow" link="external" target="_blank">[hidden email]</a>></span> wrote:<br>Hi,

I'm trying to rotate a volume and use an user defined center but no matter what value I set, it seems the rotation is always performed using the same center (not sure which, maybe a default center)?

Here's the code I'm using.. am I missing something?

        typedef itk::Euler3DTransform< double > TransformType; //Transform
                TransformType::Pointer transform = TransformType::New();
                double alfa, beta, gamma, centro_rotacion_X, centro_rotacion_Y, centro_rotacion_Z, origenX,origenY;
                gamma = atof(argv[2]);
                beta = atof(argv[3]);
                alfa = atof(argv[4]);
                centro_rotacion_X = atof(argv[5]);
                centro_rotacion_Y = atof(argv[6]);
                centro_rotacion_Z = atof(argv[7]);

                double centro[3] = { centro_rotacion_X, centro_rotacion_Y, centro_rotacion_Z }; 
                transform->SetCenter(centro);
                
                transform->SetRotation(gamma, beta, alfa);

        
        
        
<br><hr width="300" align="left">
View this message in context: <a href="http://itk-users.7.n7.nabble.com/Euler3DTransform-not-taking-user-defined-Center-of-Rotation-tp38126.html" rel="nofollow" link="external" target="_blank">Euler3DTransform not taking user defined Center of Rotation?</a><br>
Sent from the <a href="http://itk-users.7.n7.nabble.com/" rel="nofollow" link="external" target="_blank">ITK - Users mailing list archive</a> at Nabble.com.<br><br>______________________________<wbr>_______<br>
Powered by <a href="http://www.kitware.com" rel="nofollow" link="external" 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="nofollow" link="external" target="_blank">http://www.kitware.com/opensou<wbr>rce/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="nofollow" link="external" target="_blank">http://www.kitware.com/product<wbr>s/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="nofollow" link="external" target="_blank">http://www.itk.org/Wiki/ITK_FA<wbr>Q</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/insight-users" rel="nofollow" link="external" target="_blank">http://public.kitware.com/mail<wbr>man/listinfo/insight-users</a><br>
<br></div></div></div></div></blockquote></div><div><div class="m_3321816680450957495h5"><br>
<br>______________________________<wbr>_______
<br>Powered by <a href="http://www.kitware.com" rel="nofollow" link="external" 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="nofollow" link="external" target="_blank">http://www.kitware.com/opensou<wbr>rce/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="nofollow" link="external" target="_blank">http://www.kitware.com/product<wbr>s/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="nofollow" link="external" target="_blank">http://www.itk.org/Wiki/ITK_FA<wbr>Q</a><br><br>Follow this link to subscribe/unsubscribe:
<br><a href="http://public.kitware.com/mailman/listinfo/insight-users" rel="nofollow" link="external" target="_blank">http://public.kitware.com/mail<wbr>man/listinfo/insight-users</a><br>

        
        
        
        <br>
        <br>
        </div></div><hr size="1" noshade color="#cccccc">
        <div style="color:#444;font:12px tahoma,geneva,helvetica,arial,sans-serif">
                <div style="font-weight:bold">If you reply to this email, your message will be added to the discussion below:</div>
                <a href="http://itk-users.7.n7.nabble.com/Euler3DTransform-not-taking-user-defined-Center-of-Rotation-tp38126p38127.html" rel="nofollow" link="external" target="_blank">http://itk-users.7.n7.nabble.c<wbr>om/Euler3DTransform-not-taking<wbr>-user-defined-Center-of-Rotati<wbr>on-tp38126p38127.html</a>
        </div>
        <div style="color:#666;font:11px tahoma,geneva,helvetica,arial,sans-serif;margin-top:.4em;line-height:1.5em">
                
                To unsubscribe from Euler3DTransform not taking user defined Center of Rotation?, <a rel="nofollow" link="external">click here</a>.<br>
                <a href="http://itk-users.7.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml" rel="nofollow" style="font:9px serif" link="external" target="_blank">NAML</a><span class="m_3321816680450957495HOEnZb"><font color="#888888">
        </font></span></div><span class="m_3321816680450957495HOEnZb"><font color="#888888"><div dir="ltr">-- <br></div><div data-smartmail="gmail_signature"><div dir="ltr">Matias</div></div>


        
        
        
<br><hr width="300" align="left">
View this message in context: <a href="http://itk-users.7.n7.nabble.com/Euler3DTransform-not-taking-user-defined-Center-of-Rotation-tp38126p38131.html" target="_blank">Re: [ITK-users] Euler3DTransform not taking user defined Center of Rotation?</a></font></span><div class="m_3321816680450957495HOEnZb"><div class="m_3321816680450957495h5"><br>
Sent from the <a href="http://itk-users.7.n7.nabble.com/" target="_blank">ITK - Users mailing list archive</a> at Nabble.com.<br></div></div><br>______________________________<wbr>_______<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/opensou<wbr>rce/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/product<wbr>s/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_FA<wbr>Q</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/mail<wbr>man/listinfo/insight-users</a><br>
<br></blockquote></div><br></div>
</div></div><br>______________________________<wbr>_______<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/<wbr>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/<wbr>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_<wbr>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/<wbr>mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br></div>