[Insight-users] SignedDanielssonDistanceMap: squared distances inexact?

Dan Mueller dan.muel at gmail.com
Sun Jul 26 09:33:53 EDT 2009


Hi Lynx,

The SignedDanielssonDistanceMap will perform the distance computation
using real (ie. float/double) precision. If the output is integer (ie.
signed short in your case) it will cast the result. The corner pixels
(which you expect to be 2) are actual sqrt(2) = 1.414, which when cast
to signed short come out as 1.

Please find attached an input image for which the floating point
signed distance (InsideIsPositive=False) has been computed -- the
result is as expected.

HTH

Cheers, Dan

2009/7/26  <lynx.abraxas at freenet.de>:
> Hello!
>
>
> Using  the  SignedDanielssonDistanceMap and squared distances (signed short as
> output) I wonder why a distance of 2 has the same grey value as  the  distance
> 1.
> eg. input image (x white, space black):
> |   |
> | x |
> |   |
>
> The relative distance map I get looks like:
> |111|
> |1x1|
> |111|
>
> I'd expect:
> |212|
> |1x1|
> |212|
>
> Is  my  expactation wrong or is the SignedDanielssonDistanceMapImageFilter not
> that accurate? Would flout as output and not squared distances exchage the  2s
> by sqrt(2)?
>
> Thanks for any hint or help
> Lynx
-------------- next part --------------
A non-text attachment was scrubbed...
Name: distance_test_input.mha
Type: application/octet-stream
Size: 309 bytes
Desc: not available
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090726/f7ddba9f/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: distance_test_output.mha
Type: application/octet-stream
Size: 309 bytes
Desc: not available
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090726/f7ddba9f/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: distance_test_input.png
Type: image/png
Size: 411 bytes
Desc: not available
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090726/f7ddba9f/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: distance_test_output.png
Type: image/png
Size: 736 bytes
Desc: not available
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090726/f7ddba9f/attachment-0001.png>


More information about the Insight-users mailing list