<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"><<a href="mailto:dan.muel@gmail.com">dan.muel@gmail.com</a>></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ć <<a href="mailto:dzenanz@gmail.com">dzenanz@gmail.com</a>>:<br>
<div><div></div><div class="h5">> Hi guys,<br>
> I was testing SignedMaurerDistanceMapImageFilter today, and I ran into some<br>
> weird results. Namely, there seem to be some wrong results for my test<br>
> images. To make things more obvious, I created 2D test cases and they are<br>
> attached, as well as results.<br>
> bin_* are binary test images. They were extracted from 3D versions which<br>
> were written as intermediate debug output from my project (obtained using<br>
> BinaryThresholdImageFilter).<br>
> df_* are outputs created with the test program below. Some obvious errors<br>
> are circled in red. [The result for real life data is over the 80KB list<br>
> limitation so I had to remove it. The problems are in the lower left corner<br>
> and along the entire right edge.]<br>
> Are these know limitations, bugs which I discovered or my misinterpretation<br>
> of the purpose of this filter?<br>
> Regards,<br>
> Dženan<br>
> bugTester.cpp (uses ITK 3.20):<br>
> #include "itkImageFileReader.h"<br>
> #include "itkImageFileWriter.h"<br>
> #include "itkImage.h"<br>
> #include "itkContinuousIndex.h"<br>
> #include "itkSignedMaurerDistanceMapImageFilter.h"<br>
> #include "itkRescaleIntensityImageFilter.h"<br>
> #include <iostream><br>
> using namespace std;<br>
> int main( int argc, char ** argv )<br>
> {<br>
> typedef itk::Image<short, 2> ShortImageType;<br>
> typedef itk::Image<unsigned short, 2> UShortImageType;<br>
> typedef itk::Image<unsigned char, 2> VisualizingImageType;<br>
> typedef itk::ImageFileReader< VisualizingImageType > ReaderType;<br>
> ReaderType::Pointer reader = ReaderType::New();<br>
> reader->SetFileName( argv[1] ); //read binary image stored in png<br>
> reader->Update();<br>
><br>
> VisualizingImageType::Pointer image=reader->GetOutput();<br>
> typedef itk::SignedMaurerDistanceMapImageFilter<VisualizingImageType,<br>
> ShortImageType> DistanceMapType;<br>
> DistanceMapType::Pointer dm=DistanceMapType::New();<br>
> dm->SetInput(image);<br>
> dm->SquaredDistanceOff();<br>
> //dm->SetInsideIsPositive(true);<br>
> dm->Update();<br>
> typedef itk::RescaleIntensityImageFilter < ShortImageType,<br>
> UShortImageType > RescaleImageFilterType;<br>
> RescaleImageFilterType::Pointer rescale = RescaleImageFilterType::New();<br>
> rescale->SetInput( dm->GetOutput() );<br>
> rescale->Update();<br>
><br>
> typedef itk::ImageFileWriter<UShortImageType> WriterType;<br>
> WriterType::Pointer writer1=WriterType::New();<br>
> writer1->SetFileName("dfBug.png");<br>
> writer1->SetInput(rescale->GetOutput());<br>
> writer1->Update();<br>
> return 0;<br>
> }<br>
</div></div>> _____________________________________<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.html" target="_blank">http://www.kitware.com/products/protraining.html</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>
><br>
</blockquote></div><br>