<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">When I create an image, as in the example, it does not crash.<div><br></div><div>When I try to use some of the images&nbsp;(short, values equal to 0 or 1 only)&nbsp;I have obtained on real data, it crashes.</div><div><br></div><div>I'll try to figure out.</div><div><br></div><div>Thanks</div><div>françois&nbsp;</div><div><br></div><div><br><div><div>On Sep 5, 2012, at 6:27 PM, Cagatay Bilgin wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Can you post an executable code illustrating the&nbsp;<div>problem. If possible create the input image&nbsp;</div><div>programmatically.&nbsp;<br><br>Cheers,&nbsp;</div><div>Cagatay&nbsp;</div><div><br><div class="gmail_quote">On Wed, Sep 5, 2012 at 8: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&nbsp;<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 'itk::ExceptionObject'</div><div>&nbsp; what(): &nbsp;/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'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><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:&nbsp;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>
</blockquote></div><br><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>--</div><div>---------------------------</div><div>Francois Rousseau</div><div>LSIIT</div><div>Pôle API</div><div>Boulevard Sébastien Brant</div><div>F-67400 ILLKIRCH</div><div>tel : +33 3 68 85 44 89</div><div>email :&nbsp;<a href="mailto:rousseau@unistra.fr">rousseau@unistra.fr</a></div><div><a href="http://lsiit-miv.u-strasbg.fr/miv/19-ROUSSEAU-Francois.html">http://lsiit-miv.u-strasbg.fr/miv/19-ROUSSEAU-Francois.html</a></div></div></span></div></span></span>
</div>
<br></div></body></html>