Can you post an executable code illustrating the <div>problem. If possible create the input image </div><div>programmatically. <br><br>Cheers, </div><div>Cagatay </div><div><br><div class="gmail_quote">On Wed, Sep 5, 2012 at 8:07 AM, francois rousseau <span dir="ltr"><<a href="mailto:rousseau@unistra.fr" target="_blank">rousseau@unistra.fr</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi,<div><br></div><div>I do have some issue to use the <span style="font-family:monospace;white-space:pre-wrap">ApproximateSignedDistanceMapImageFilterType</span></div>
<div>I saw fews threads about that in ITK mailing list, but the problem here seems to be different.</div><div><br></div><div>The input image contains 0 and 1 values. It is a short image.</div><div><br></div><div>Here the code I use:</div>
<div>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0"> </span><span style="color:#808000">typedef</span><span style="color:#c0c0c0"> </span><span style="color:#800080">itk</span><span style>::</span><span style="color:#800080">ApproximateSignedDistanceMapImageFilter</span><span style><</span><span style="color:#c0c0c0"> </span><span style="color:#800080">ImageType</span><span style>,</span><span style="color:#c0c0c0"> </span><span style="color:#800080">FloatImageType</span><span style="color:#c0c0c0"> </span><span style>></span><span style="color:#c0c0c0"> </span><span style="color:#800080">ApproximateSignedDistanceMapImageFilterType</span><span style>;</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0"> </span>ApproximateSignedDistanceMapImageFilterType<span style>::</span>Pointer<span style="color:#c0c0c0"> </span><span style>filter</span><span style="color:#c0c0c0"> </span><span style>=</span><span style="color:#c0c0c0"> </span>ApproximateSignedDistanceMapImageFilterType<span style>::</span>New<span style>();</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0"> </span><span style>filter</span><span style>-></span>SetInput<span style>(</span><span style>inputImage</span><span style>);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0"> </span><span style>filter</span><span style>-></span>SetInsideValue<span style>(</span><span style="color:#000080">1</span><span style>);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0"> </span><span style>filter</span><span style>-></span>SetOutsideValue<span style>(</span><span style="color:#000080">0</span><span style>);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0"> </span><span style>filter</span><span style>-></span>Update<span style>();</span></pre><div>
<br></div></div><div>Here is the message in the terminal I get:</div><div><div>terminate called after throwing an instance of 'itk::ExceptionObject'</div><div> what(): /Users/rousseau/Code/src/InsightToolkit-4.0.0/Modules/Core/Common/src/itkMultiThreader.cxx:355:</div>
<div>itk::ERROR: MultiThreader(0x7fe592013000): Exception occurred during SingleMethodExecute</div><div>Abort trap: 6</div></div><div><br></div><div>The debugger indicates this line: 285 in itkImageBase.hxx (the update function)</div>
<div>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#808000">template</span><span style><</span><span style="color:#c0c0c0"> </span><span style="color:#808000">unsigned</span><span style="color:#c0c0c0"> </span><span style="color:#808000">int</span><span style="color:#c0c0c0"> </span>VImageDimension<span style="color:#c0c0c0"> </span><span style>></span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#808000">void</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#800080">ImageBase</span><span style><</span><span style="color:#c0c0c0"> </span>VImageDimension<span style="color:#c0c0c0"> </span><span style>></span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style>::</span><span style="font-style:italic">UpdateOutputData</span><span style>()</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style>{</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0"> </span><span style="color:#008000">// If the requested region does not contain any pixels then there is</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0"> </span><span style="color:#008000">// no reason to Update the output data. This is needed so that</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0"> </span><span style="color:#008000">// filters don't need to update all inputs. This occours in</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0"> </span><span style="color:#008000">// ImageBase as oppose to DataObject, but cause this statement</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0"> </span><span style="color:#008000">// requires the specific GetNumberOfPixels methods ( as oppose to a</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0"> </span><span style="color:#008000">// generic Region::IsEmpty method ).</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0"> </span><span style="color:#008000">//</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0"> </span><span style="color:#008000">// Also note, the check of the largest possible region is needed so</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0"> </span><span style="color:#008000">// that an exception will be thrown in the process object when no</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0"> </span><span style="color:#008000">// input has been set. ( This part of the statement could be removed</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0"> </span><span style="color:#008000">// if this check happened earlier in the pipeline )</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0"> </span><span style="color:#808000">if</span><span style="color:#c0c0c0"> </span><span style>(</span><span style="color:#c0c0c0"> </span><span style="color:#808000">this</span><span style>-></span><span style="font-style:italic">GetRequestedRegion</span><span style>().</span>GetNumberOfPixels<span style>()</span><span style="color:#c0c0c0"> </span><span style>></span><span style="color:#c0c0c0"> </span><span style="color:#000080">0</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0"> </span><span style>||</span><span style="color:#c0c0c0"> </span><span style="color:#808000">this</span><span style>-></span><span style="font-style:italic">GetLargestPossibleRegion</span><span style>().</span>GetNumberOfPixels<span style>()</span><span style="color:#c0c0c0"> </span><span style>==</span><span style="color:#c0c0c0"> </span><span style="color:#000080">0</span><span style="color:#c0c0c0"> </span><span style>)</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0"> </span><span style>{</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0"> </span><span style="color:#808000">this</span><span style>-></span>Superclass<span style>::</span><span style="font-style:italic">UpdateOutputData</span><span style>();</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0"> </span><span style>}</span></pre>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style>}</span></pre><div><br></div></div><div>Am I doing something wrong?</div><div><br></div><div>Thanks</div><div>françois</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<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.php" 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" 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></blockquote></div><br><br clear="all"><div><br></div>-- <br><span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Cemal Cagatay Bilgin</span><br style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Life Sciences Division</span><br style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Lawrence Berkeley National Lab</span><br style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">MS977, One Cyclotron Road</span><br style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Berkeley, CA 94720, USA</span><br style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Email: ccbilgin</span><a href="mailto:hchang@lbl.gov" style="color:rgb(17,85,204);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)" target="_blank">@lbl.gov</a><br>
</div>