[Insight-users] Problems with Maurer Distance Transform

Luis Ibanez luis.ibanez at kitware.com
Sun Apr 25 12:43:53 EDT 2010


Hi Christian,


As described in the Insight Journal paper:

"N-D Linear Time Exact Signed Euclidean Distance Transform"
Tustison N.J., Siqueira M., Gee J.C.
University of Pennsylvania
http://www.insight-journal.org/browse/publication/77
http://hdl.handle.net/1926/171


where the ITK implementation of the Maurer filter was
introduced,


The Maurer filter computes the exact euclidean distance
(down to numerical precision), while the Danielsson
distance filter only approximates the distance up to a
1 pixel spacing values.


It is therefore, not surprising that you find differences
between the distance values reported by these two
filters....

However, the output that you are reporting for the
Signed Maurer distance really looks plain wrong     :-(


It would seem that you have a problem in the
instantiation of the filter.


I just ran the Signed Maurer from a modified version
of the Test in

        Insight/Testing/Code/BasicFilters

and using your input image (BTW: Thanks a lot for
providing the input image and output images, that
makes things a lot easier)  and it works fine for me.


Please find attached to this email the source
code that I used, and the output that I get from
the rescaled distance.


Note that the distance is produced as an image
of pixel type double, so the command line that
I used was:


MaurerDistance input_image.png distance.mha \
maurer_output_uchar.png

The exact distances are stored in the distance.mha
file ( the MetaImage file format supports pixel type
"double"), while the .png image holds a rescaled
version of the distance, that is just intended for
visualization (that rescaled one is the one attached
to this email).

I had to pass the .png file through GIMP in order
to compress it further as a jpg file, to be able to
attach it to this email. The mailing list restricts
email size to 40Kb.

--

Please note also the setting of the filter:

  filter->SetSquaredDistance( false );
  filter->SetUseImageSpacing( false );
  filter->SetInsideIsPositive( false );


Please give it a try at this code and let us know
if you find any problem.


     Thanks


          Luis


-----------------------------------------------------------------------------------
On Sun, Apr 25, 2010 at 11:58 AM, Christian Werner <
christian.werner at rwth-aachen.de> wrote:

> Hi!
>
> 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?
>
> 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:
>
>  ///// typedef typename itk::DanielssonDistanceMapImageFilter< ImageType,
> ImageType > FilterType;
>  typedef typename itk::SignedMaurerDistanceMapImageFilter< ImageType,
> ImageType > FilterType;
>  typename FilterType::Pointer filter = FilterType::New();
>  filter->SetInput( itkImporter->GetOutput() );
>
> Any idea?
>
>
> Best regards,
> Christian
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100425/4ebf43cc/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: itkSignedMaurerDistanceMapImageFilter.cxx
Type: text/x-c++src
Size: 2635 bytes
Desc: not available
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100425/4ebf43cc/attachment-0001.cxx>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: maurer_output_uchar.jpg
Type: image/jpeg
Size: 6565 bytes
Desc: not available
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100425/4ebf43cc/attachment-0001.jpg>


More information about the Insight-users mailing list