<font><font face="verdana,sans-serif">I also saw this warning recently, from the block that &quot;never gets called&quot;. And it only happened in release version of my program.<br></font></font><br><div class="gmail_quote">

On Tue, Jan 31, 2012 at 00:48, Maarten Beek <span dir="ltr">&lt;<a href="mailto:beekmaarten@yahoo.com">beekmaarten@yahoo.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div><div style="font-size:12pt;font-family:times new roman,new york,times,serif"><div><span>Hi David,<br>
</span></div>
<div><br></div><div>Ai, seems these crashes are hard to get rid off....<br></div><div><br>
</div>
<div>I currently use VTK within Amira modules.</div>
<div><br>
</div>
<div>I changed the type of vtkPoints 
from the default VTK_FLOAT to VTK_DOUBLE when I convert an Amira object 
to a VTK object. This reduces the occurrences of the errors, but doesn&#39;t
 solve the issue.</div>
<div>(Ps: why is the default in vtkPoints still float, while everywhere else floats were changed into doubles a long while ago?)<br>
</div>
<div><br>
</div>
<div><span>I don&#39;t really know much about different optimizations, so I just copy-paste what I found in MSVS:</span></div>
<div><span><br>
  </span></div>
<div><span>I build my VTK with:<br>
  </span></div>
<div><span>/O2
 /Ob2 /FD /EHsc /MD /Fo&quot;vtkCommon.dir\Release\\&quot; 
/Fd&quot;G:\vtk-5.6.0\build_vs90_noQt\bin\Release/vtkCommon.pdb&quot; /W4 /nologo 
/c /TP /errorReport:prompt/Zm 1000 and a couple of &#39;/I&#39;-s and &#39;/D&#39;-s<br></span></div>
<div><br>
</div>
<div>I build my Amira modules with:</div>
<div>/O2 /Ob1 /Oi /Oy /GF /FD /EHsc /MD
 /GS- /Gy /fp:fast /openmp 
/Fo&quot;./../../obj/arch-Win64VC9-Optimize/GraphPackage/&quot; 
/Fd&quot;./../.././bin/arch-Win64VC9-Optimize/GraphPackage.pdb&quot; /W3 /nologo 
/c /Zi /wd4068 /wd4305 /wd4018 /wd4244 /wd4800 /wd4275 /wd4251 
/errorReport:prompt and a couple <span>of &#39;/I&#39;-s and &#39;/D&#39;-s</span></div>
<div><br>
  <span></span></div>
<div><span>I
 am working on getting vtkMath::JacobiN to print the matrix in the 
if-loop that &#39;gets never called&#39; using vtkGenericWarningMacro to avoid 
having to include Amira stuff. Having a hard time getting that to work. (
 char* test = &quot;hello&quot;;vtkGenericWarningMacro( test ); won&#39;t do the trick). Any suggestions?<span class="HOEnZb"><font color="#888888"><br>
  </font></span></span></div><span class="HOEnZb"><font color="#888888">
<div><br>
  <span></span></div>
<div><span>Maarten</span></div></font></span><div><br></div><div class="hm HOEnZb">  </div><div style="font-family:times new roman,new york,times,serif;font-size:12pt"><div class="hm HOEnZb"> </div><div style="font-family:times new roman,new york,times,serif;font-size:12pt">

<div class="hm HOEnZb"> <div dir="ltr"> <font face="Arial"> <hr size="1">  <b><span style="font-weight:bold">From:</span></b> David Gobbi &lt;<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a>&gt;<br>

 <b><span style="font-weight:bold">To:</span></b> Maarten Beek &lt;<a href="mailto:beekmaarten@yahoo.com" target="_blank">beekmaarten@yahoo.com</a>&gt; <br><b><span style="font-weight:bold">Cc:</span></b> VTK list &lt;<a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a>&gt; <br>

 <b><span style="font-weight:bold">Sent:</span></b> Monday, January 30, 2012 2:31:38 PM<br> <b><span style="font-weight:bold">Subject:</span></b> Re: [vtkusers] ICP Error: vtkMath::Jacobi: Error extracting eigenfunctions<br>

 </font> </div></div><div><div class="h5"> <br>Hi Maarten,<br><br>I think there are two issues here, one is that vtkLandmarkTransform<br>should have a check as you have described, but another
 potentially<br>serious issue is that, as far as I understand it, JacobiN should never<br>fail.  I did a google search and found a message from 2002 by the<br>Numerical Recipes authors stating that the NR Jacobi code can become<br>

numerically unstable due to certain compiler optimizations.  I&#39;m<br>guessing that certain compiler optimizations could similarly make the<br>VTK Jacobi code become unstable.<br><a href="http://www.nr.com/forum/showthread.php?p=4913" target="_blank">http://www.nr.com/forum/showthread.php?p=4913</a><br>

<br>Can you provide info about your compiler/flags etc?  Also, is it<br>possible to get your code to print a matrix that causes JacobiN to<br>fail?<br><br> - David<br><br><br>On Mon, Jan 30, 2012 at 9:44 AM, Maarten Beek &lt;<a href="mailto:beekmaarten@yahoo.com" target="_blank">beekmaarten@yahoo.com</a>&gt; wrote:<br>

&gt; Hi all,<br>&gt;<br>&gt; I get the following warning when using
 ICP:<br>&gt;<br>&gt; vtkMath::Jacobi: Error extracting eigenfunctions<br>&gt;<br>&gt; It comes from vtkMath::vtkJacobiN that calculates the eigenvalues, -vectors<br>&gt; of a matrix.<br>&gt; The function returns 0, when this error occurs (otherwise 1), but<br>

&gt; vtkLandmarkTransform doesn&#39;t check for the return value and thus uses<br>&gt; undefined values for the eigenvalues, -vectors.<br>&gt; This means my point set becomes invalid.<br>&gt; I believe the way to avoid this error is to &#39;giggle&#39; the coordinates a<br>

&gt; little when it happens, but how can I intervene when vtkLandmarkTransform<br>&gt; stubbornly uses whatever values it gets from vtkMath::vtkJacobiN?<br>&gt; Is there a way to intercept the error message?<br>&gt;<br>&gt; I also noticed that if I apply ICP on A and B1 resulting in the error<br>

&gt; message, applying ICP on A and B2 (loading the same data file that gives me<br>&gt; B1) works fine. I don&#39;t see vtkMath::vtkJacobiN using a
 random number or<br>&gt; doing something similar, which makes me believe the error message I get is<br>&gt; due to floating point accuracy? Even more a reason to think that &#39;giggling&#39;<br>&gt; might work (if I were able to intervene before the invalid transform is<br>

&gt; applied to my data...)<br>&gt;<br>&gt; Thanks - Maarten<br><br><br> </div></div></div> </div>  </div></div><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 <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br>