<br>Hi Christian,<br><br><br>As described in the Insight Journal paper:<br><br><div id="publication">
<div class="title">"N-D Linear Time Exact Signed Euclidean Distance Transform"</div>
<div class="authors">Tustison N.J., Siqueira M., Gee J.C.</div>
<div class="institution">University of Pennsylvania</div></div>
<a href="http://www.insight-journal.org/browse/publication/77">http://www.insight-journal.org/browse/publication/77</a><br><a href="http://hdl.handle.net/1926/171">http://hdl.handle.net/1926/171</a><br><br><br>where the ITK implementation of the Maurer filter was <br>
introduced,<br><br><br>The Maurer filter computes the exact euclidean distance<br>(down to numerical precision), while the Danielsson <br>distance filter only approximates the distance up to a<br>1 pixel spacing values.<br>
<br><br>It is therefore, not surprising that you find differences<br>between the distance values reported by these two<br>filters....<br><br>However, the output that you are reporting for the <br>Signed Maurer distance really looks plain wrong :-(<br>
<br><br>It would seem that you have a problem in the <br>instantiation of the filter.<br><br><br>I just ran the Signed Maurer from a modified version<br>of the Test in <br><br> Insight/Testing/Code/BasicFilters <br>
<br>and using your input image (BTW: Thanks a lot for <br>providing the input image and output images, that <br>makes things a lot easier) and it works fine for me.<br><br><br>Please find attached to this email the source <br>
code that I used, and the output that I get from<br>the rescaled distance. <br><br><br>Note that the distance is produced as an image<br>of pixel type double, so the command line that<br>I used was:<br><br><br>MaurerDistance input_image.png distance.mha \<br>
maurer_output_uchar.png<br><br>The exact distances are stored in the distance.mha<br>file ( the MetaImage file format supports pixel type<br>"double"), while the .png image holds a rescaled<br>version of the distance, that is just intended for <br>
visualization (that rescaled one is the one attached<br>to this email).<br><br>I had to pass the .png file through GIMP in order<br>to compress it further as a jpg file, to be able to<br>attach it to this email. The mailing list restricts<br>
email size to 40Kb.<br><br>--<br><br>Please note also the setting of the filter:<br><br> filter->SetSquaredDistance( false );<br> filter->SetUseImageSpacing( false );<br> filter->SetInsideIsPositive( false );<br>
<br><br>Please give it a try at this code and let us know <br>if you find any problem.<br><br><br> Thanks<br><br><br> Luis<br><br><br>-----------------------------------------------------------------------------------<br>
<div class="gmail_quote">On Sun, Apr 25, 2010 at 11:58 AM, Christian Werner <span dir="ltr"><<a href="mailto:christian.werner@rwth-aachen.de">christian.werner@rwth-aachen.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi!<br>
<br>
I need a nice DistanceTransformation function. Danielsson is fine but slooooow. Then I tried the SignedMaurerDistanceMapImageFilter which is quite fast. Unfortunately the results are quite different. It seems the DanielsonDistanceMapImageFilter yields better results. What am I doing wrong?<br>
<br>
I am passing no input parameter to the filters, I just put them in the pipeline. Maybe I am missing important parameters? They are both used the exactly same way:<br>
<br>
///// typedef typename itk::DanielssonDistanceMapImageFilter< ImageType, ImageType > FilterType;<br>
typedef typename itk::SignedMaurerDistanceMapImageFilter< ImageType, ImageType > FilterType;<br>
typename FilterType::Pointer filter = FilterType::New();<br>
filter->SetInput( itkImporter->GetOutput() );<br>
<br>
Any idea?<br>
<br>
<br>
Best regards,<br><font color="#888888">
Christian<br>
</font><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.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></blockquote></div><br>