<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi,<div><br></div><div>I do have some issue to use the&nbsp;<span class="Apple-style-span" style="font-family: monospace; white-space: pre; ">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; -qt-block-indent:0; text-indent:0px;"><!--StartFragment--><span style=" color:#c0c0c0;">  </span><span style=" color:#808000;">typedef</span><span style=" color:#c0c0c0;">  </span><span style=" color:#800080;">itk</span><span style=" color:#000000;">::</span><span style=" color:#800080;">ApproximateSignedDistanceMapImageFilter</span><span style=" color:#000000;">&lt;</span><span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">ImageType</span><span style=" color:#000000;">,</span><span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">FloatImageType</span><span style=" color:#c0c0c0;">  </span><span style=" color:#000000;">&gt;</span><span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">ApproximateSignedDistanceMapImageFilterType</span><span style=" color:#000000;">;</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">  </span>ApproximateSignedDistanceMapImageFilterType<span style=" color:#000000;">::</span>Pointer<span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">filter</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">=</span><span style=" color:#c0c0c0;"> </span>ApproximateSignedDistanceMapImageFilterType<span style=" color:#000000;">::</span>New<span style=" color:#000000;">();</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">  </span><span style=" color:#000000;">filter</span><span style=" color:#000000;">-&gt;</span>SetInput<span style=" color:#000000;">(</span><span style=" color:#000000;">inputImage</span><span style=" color:#000000;">);</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">  </span><span style=" color:#000000;">filter</span><span style=" color:#000000;">-&gt;</span>SetInsideValue<span style=" color:#000000;">(</span><span style=" color:#000080;">1</span><span style=" color:#000000;">);</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">  </span><span style=" color:#000000;">filter</span><span style=" color:#000000;">-&gt;</span>SetOutsideValue<span style=" color:#000000;">(</span><span style=" color:#000080;">0</span><span style=" color:#000000;">);</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">  </span><span style=" color:#000000;">filter</span><span style=" color:#000000;">-&gt;</span>Update<span style=" color:#000000;">();</span><!--EndFragment--></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; -qt-block-indent:0; text-indent:0px;"><!--StartFragment--><span style=" color:#808000;">template</span><span style=" color:#000000;">&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=" color:#000000;">&gt;</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#808000;">void</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#800080;">ImageBase</span><span style=" color:#000000;">&lt;</span><span style=" color:#c0c0c0;"> </span>VImageDimension<span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">&gt;</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#000000;">::</span><span style=" font-style:italic; color:#000000;">UpdateOutputData</span><span style=" color:#000000;">()</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#000000;">{</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; 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; -qt-block-indent:0; 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; -qt-block-indent:0; 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; -qt-block-indent:0; 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; -qt-block-indent:0; 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; -qt-block-indent:0; 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; -qt-block-indent:0; 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; -qt-block-indent:0; 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; -qt-block-indent:0; 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; -qt-block-indent:0; 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; -qt-block-indent:0; 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; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">  </span><span style=" color:#808000;">if</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">(</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">this</span><span style=" color:#000000;">-&gt;</span><span style=" font-style:italic; color:#000000;">GetRequestedRegion</span><span style=" color:#000000;">().</span>GetNumberOfPixels<span style=" color:#000000;">()</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">&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; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">       </span><span style=" color:#000000;">||</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">this</span><span style=" color:#000000;">-&gt;</span><span style=" font-style:italic; color:#000000;">GetLargestPossibleRegion</span><span style=" color:#000000;">().</span>GetNumberOfPixels<span style=" color:#000000;">()</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">==</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000080;">0</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">)</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">    </span><span style=" color:#000000;">{</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">    </span><span style=" color:#808000;">this</span><span style=" color:#000000;">-&gt;</span>Superclass<span style=" color:#000000;">::</span><span style=" font-style:italic; color:#000000;">UpdateOutputData</span><span style=" color:#000000;">();</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">    </span><span style=" color:#000000;">}</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#000000;">}</span><!--EndFragment--></pre><div><br></div></div><div>Am I doing something wrong?</div><div><br></div><div>Thanks</div><div>françois</div></body></html>