Please show how inputImage is produced.<br><br><div class="gmail_quote">On Wed, Sep 5, 2012 at 11:07 AM, francois rousseau <span dir="ltr">&lt;<a href="mailto:rousseau@unistra.fr" target="_blank">rousseau@unistra.fr</a>&gt;</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>&lt;</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>&gt;</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>-&gt;</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>-&gt;</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>-&gt;</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>-&gt;</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 &#39;itk::ExceptionObject&#39;</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>&lt;</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>&gt;</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>&lt;</span><span style="color:#c0c0c0"> </span>VImageDimension<span style="color:#c0c0c0"> </span><span style>&gt;</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&#39;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>-&gt;</span><span style="font-style:italic">GetRequestedRegion</span><span style>().</span>GetNumberOfPixels<span style>()</span><span style="color:#c0c0c0"> </span><span style>&gt;</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>-&gt;</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>-&gt;</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>Unpaid intern in BillsBasement at noware dot com<br><br>