<font size="2"><font face="verdana,sans-serif">Should I submit the bug report?<br></font></font><br><div class="gmail_quote">2011/3/21 Dan Mueller <span dir="ltr">&lt;<a href="mailto:dan.muel@gmail.com">dan.muel@gmail.com</a>&gt;</span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi Dženan,<br>
<br>
Changing the output type from short to float avoids the issue (see attached).<br>
<br>
To me this looks like a bug related to use with integer output images:<br>
    <a href="http://www.itk.org/Bug/" target="_blank">http://www.itk.org/Bug/</a><br>
<br>
Regards, Dan<br>
<br>
2011/3/21 Dženan Zukić &lt;<a href="mailto:dzenanz@gmail.com">dzenanz@gmail.com</a>&gt;:<br>
<div><div></div><div class="h5">&gt; Hi guys,<br>
&gt; I was testing SignedMaurerDistanceMapImageFilter today, and I ran into some<br>
&gt; weird results. Namely, there seem to be some wrong results for my test<br>
&gt; images. To make things more obvious, I created 2D test cases and they are<br>
&gt; attached, as well as results.<br>
&gt; bin_* are binary test images. They were extracted from 3D versions which<br>
&gt; were written as intermediate debug output from my project (obtained using<br>
&gt; BinaryThresholdImageFilter).<br>
&gt; df_* are outputs created with the test program below. Some obvious errors<br>
&gt; are circled in red. [The result for real life data is over the 80KB list<br>
&gt; limitation so I had to remove it. The problems are in the lower left corner<br>
&gt; and along the entire right edge.]<br>
&gt; Are these know limitations, bugs which I discovered or my misinterpretation<br>
&gt; of the purpose of this filter?<br>
&gt; Regards,<br>
&gt; Dženan<br>
&gt; bugTester.cpp (uses ITK 3.20):<br>
&gt; #include &quot;itkImageFileReader.h&quot;<br>
&gt; #include &quot;itkImageFileWriter.h&quot;<br>
&gt; #include &quot;itkImage.h&quot;<br>
&gt; #include &quot;itkContinuousIndex.h&quot;<br>
&gt; #include &quot;itkSignedMaurerDistanceMapImageFilter.h&quot;<br>
&gt; #include &quot;itkRescaleIntensityImageFilter.h&quot;<br>
&gt; #include &lt;iostream&gt;<br>
&gt; using namespace std;<br>
&gt; int main( int argc, char ** argv )<br>
&gt; {<br>
&gt;     typedef itk::Image&lt;short, 2&gt; ShortImageType;<br>
&gt;     typedef itk::Image&lt;unsigned short, 2&gt; UShortImageType;<br>
&gt;     typedef itk::Image&lt;unsigned char, 2&gt; VisualizingImageType;<br>
&gt;     typedef itk::ImageFileReader&lt; VisualizingImageType &gt;  ReaderType;<br>
&gt;     ReaderType::Pointer reader = ReaderType::New();<br>
&gt;     reader-&gt;SetFileName( argv[1]  ); //read binary image stored in png<br>
&gt;     reader-&gt;Update();<br>
&gt;<br>
&gt;     VisualizingImageType::Pointer image=reader-&gt;GetOutput();<br>
&gt;     typedef itk::SignedMaurerDistanceMapImageFilter&lt;VisualizingImageType,<br>
&gt; ShortImageType&gt; DistanceMapType;<br>
&gt;     DistanceMapType::Pointer dm=DistanceMapType::New();<br>
&gt;     dm-&gt;SetInput(image);<br>
&gt;     dm-&gt;SquaredDistanceOff();<br>
&gt;     //dm-&gt;SetInsideIsPositive(true);<br>
&gt;     dm-&gt;Update();<br>
&gt;     typedef itk::RescaleIntensityImageFilter &lt; ShortImageType,<br>
&gt; UShortImageType &gt; RescaleImageFilterType;<br>
&gt;     RescaleImageFilterType::Pointer rescale = RescaleImageFilterType::New();<br>
&gt;     rescale-&gt;SetInput( dm-&gt;GetOutput() );<br>
&gt;     rescale-&gt;Update();<br>
&gt;<br>
&gt;     typedef itk::ImageFileWriter&lt;UShortImageType&gt; WriterType;<br>
&gt;     WriterType::Pointer writer1=WriterType::New();<br>
&gt;     writer1-&gt;SetFileName(&quot;dfBug.png&quot;);<br>
&gt;     writer1-&gt;SetInput(rescale-&gt;GetOutput());<br>
&gt;     writer1-&gt;Update();<br>
&gt;     return 0;<br>
&gt; }<br>
</div></div>&gt; _____________________________________<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Kitware offers ITK Training Courses, for more information visit:<br>
&gt; <a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the ITK FAQ at:<br>
&gt; <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
&gt;<br>
&gt;<br>
</blockquote></div><br>