<div dir="ltr">Hi Bradley,<div>I have <span style="color:rgb(80,0,80);font-size:12.8px">tried casting to sitkFloat64, but the same error message :</span></div><div><span style="color:rgb(80,0,80);font-size:12.8px"><br></span></div><div><span style="color:rgb(80,0,80);font-size:12.8px"> Error in f(...) : Exception in SITK - check warning messages In addition: Warning message:<br>In f(...) :<br>  Exception thrown in SimpleITK TransformToDisplacementFieldFilter_Execute: /tmp/RtmpE4PobR/devtools25774a9d4940/SimpleITK-SimpleITKRInstaller-5f821a0/SITK/Build/SimpleITK-build/Code/BasicFilters/src/sitkTransformToDisplacementFieldFilter.cxx:178:<br>sitk::ERROR: Unexpected error converting transform! Possible miss matching dimensions!<br></span></div><div><span style="color:rgb(80,0,80);font-size:12.8px"><br></span></div><div><span style="color:rgb(80,0,80);font-size:12.8px">do you have a code example of 2D registration involving two png in simpleITK ? it could help me to test where the problem comes from <br></span></div><div><span style="color:rgb(80,0,80);font-size:12.8px"><br></span></div><div><span style="color:rgb(80,0,80);font-size:12.8px">Cheers,</span></div><div><span style="color:rgb(80,0,80);font-size:12.8px"><br></span></div><div><span style="color:rgb(80,0,80);font-size:12.8px">Fabien<br></span></div><div><span style="color:rgb(80,0,80);font-size:12.8px"><br></span></div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-08-18 19:05 GMT-03:00 Lowekamp, Bradley (NIH/NLM/LHC) [C] [via ITK - Users] <span dir="ltr"><<a href="/user/SendEmail.jtp?type=node&node=38645&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>></span>:<br><blockquote style='border-left:2px solid #CCCCCC;padding:0 1em' class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">

        Have you tried casting to sitkFloat64?
<br></span><div class="m_-5305669711468421315shrinkable-quote"><div><div class="h5"><div class='shrinkable-quote'><br>> On Aug 18, 2017, at 12:49 PM, FWagner <<a href="http:///user/SendEmail.jtp?type=node&node=38644&i=0" rel="nofollow" link="external" target="_blank">[hidden email]</a>> wrote:
<br>> 
<br>> Hi,
<br>> I have some trouble using the demons_registration from
<br>> <a href="https://insightsoftwareconsortium.github.io/SimpleITK-Notebooks/R_html/66_Registration_Demons.html" rel="nofollow" link="external" target="_blank">https://<wbr>insightsoftwareconsortium.<wbr>github.io/SimpleITK-Notebooks/<wbr>R_html/66_Registration_Demons.<wbr>html</a><br>> I have tested the example and it work well. however when i used the function 
<br>> demons_registration with two image .png that i have generated i have some
<br>> strange errors. See the R code and the error below 
<br>> 
<br>> # generate two image of a square slighty differents
<br>> library(raster)
<br>> library(imager)
<br>> r=raster(ncol=600,nrow=600)
<br>> r=setValues(r,1)
<br>> im1=as.cimg(r)
<br>> im1[200:300,200:300]=0
<br>> plot(im1)
<br>> 
<br>> im2=as.cimg(r)
<br>> im2[210:320,210:320]=0
<br>> plot(im2)
<br>> 
<br>> save.image(im1,"square1.png")
<br>> save.image(im2,"square2.png")
<br>> 
<br>> library(SimpleITK)
<br>> 
<br>> cntrl <- ReadImage("square1.png")
<br>> img1 = Cast(cntrl,"sitkFloat32")
<br>> img1
<br>> 
<br>> cntrl <- ReadImage("square2.png")
<br>> img2 = Cast(cntrl,"sitkFloat32")
<br>> img2
<br>> 
<br>> # the demons_registration function can be downloaded here :
<br>> <a href="https://insightsoftwareconsortium.github.io/SimpleITK-Notebooks/R_html/66_Registration_Demons.html" rel="nofollow" link="external" target="_blank">https://<wbr>insightsoftwareconsortium.<wbr>github.io/SimpleITK-Notebooks/<wbr>R_html/66_Registration_Demons.<wbr>html</a><br>> 
<br>> tx <- demons_registration(fixed_<wbr>image = img1, moving_image = img2)
<br>> Show Traceback
<br>> 
<br>> Rerun with Debug
<br>> Error in f(...) : Exception in SITK - check warning messages In addition:
<br>> Warning message:
<br>> In f(...) :
<br>>  Exception thrown in SimpleITK TransformToDisplacementFieldFi<wbr>lter_Execute:
<br>> /tmp/RtmpE4PobR/<wbr>devtools25774a9d4940/<wbr>SimpleITK-SimpleITKRInstaller-<wbr>5f821a0/SITK/Build/SimpleITK-<wbr>build/Code/BasicFilters/src/<wbr>sitkTransformToDisplacementFie<wbr>ldFilter.cxx:178:
<br>> sitk::ERROR: Unexpected error converting transform! Possible miss matching
<br>> dimensions!
<br>> 
<br>> 
<br>> Does anyone have an idea of the problem ?
<br>> 
<br>> Thank you very much,
<br>> 
<br>> 
<br>> Fabien
<br>> 
<br>> 
<br>> 
<br>> 
<br>> --
<br>> View this message in context: <a href="http://itk-users.7.n7.nabble.com/SimpleITK-and-R-demons-registration-problem-tp38641.html" rel="nofollow" link="external" target="_blank">http://itk-users.7.n7.nabble.<wbr>com/SimpleITK-and-R-demons-<wbr>registration-problem-tp38641.<wbr>html</a><br>> Sent from the ITK - Users mailing list archive at Nabble.com.
<br>> ______________________________<wbr>_______
<br>> Powered by <a href="http://www.kitware.com" target="_blank" rel="nofollow" link="external">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/<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="nofollow" link="external" 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="nofollow" link="external" 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="nofollow" link="external" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/insight-users</a></div></div></div>> ______________________________<wbr>_________________
<br>> Community mailing list
<br>> <a href="http:///user/SendEmail.jtp?type=node&node=38644&i=1" rel="nofollow" link="external" target="_blank">[hidden email]</a>
<br>> <a href="http://public.kitware.com/mailman/listinfo/community" rel="nofollow" link="external" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/community</a></div><span class="">______________________________<wbr>_______
<br>Powered by <a href="http://www.kitware.com" target="_blank" rel="nofollow" link="external">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/<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="nofollow" link="external" 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="nofollow" link="external" 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="nofollow" link="external" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/insight-users</a><br>

        
        
        
        <br>
        <br>
        </span><hr noshade size="1" 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/SimpleITK-and-R-demons-registration-problem-tp38641p38644.html" target="_blank" rel="nofollow" link="external">http://itk-users.7.n7.nabble.<wbr>com/SimpleITK-and-R-demons-<wbr>registration-problem-<wbr>tp38641p38644.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 SimpleITK and R demons_registration problem, <a href="" target="_blank" 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" target="_blank" link="external">NAML</a>
        </div></blockquote></div><br></div>


        
        
        
<br/><hr align="left" width="300" />
View this message in context: <a href="http://itk-users.7.n7.nabble.com/SimpleITK-and-R-demons-registration-problem-tp38641p38645.html">Re: [ITK-users] [ITK] SimpleITK and R demons_registration problem</a><br/>
Sent from the <a href="http://itk-users.7.n7.nabble.com/">ITK - Users mailing list archive</a> at Nabble.com.<br/>