[Insight-users] SignedDanielssonDistanceMap: squared distances inexact?

Richard Beare richard.beare at gmail.com
Tue Jul 28 19:36:59 EDT 2009


The Danielsson does include an approximation, but should be exact over
the scales in your image, I think. Presumably you're using floating
point?

However the sort of issue you demonstrate is a common problem with
this approach. You have some blobs that are broken up more than you'd
want, and some not quite enough.

If you examine the blob you're asking about closely, I suspect you'll
find that there is really only one, extended, peak in the distance
transform. Sometime this is counter intuitive, but usually close
examination shows that the correct thing has happened. The key is
often that there are "nicks" in the border, so parts of the edge are a
bit closer than expected to the perceived centre of the object. It
looks to me like the left hand side of that blob is flattened a bit,
which might explain what you're seeing.

On Wed, Jul 29, 2009 at 7:15 AM, <lynx.abraxas at freenet.de> wrote:
> Dear Luis,
>
>
> I'm  sorry I forgot to attach the anotated image. Here it is. The arrow points
> on the blob I would have thought would get separated along the dotted  line  I
> drew in. It's not getting separated because there's only one minimum found. So
> as I discribed before I think the problem originates from  the  distance  map.
> I'm  not  sure  perhaps  I'm  missing  something  there.  But I'd say that the
> distance to the closest border increases from the  centre  of  the  separation
> line I drew to the centre of the left part of the blob.
>
> Any ideas? Am I wrong with my expactation?
>
> Regards,
> Lynx
>
>
> On 28/07/09 07:31:13, Luis Ibanez wrote:
>> Hi Lynx,
>>
>> Could you please list the colors of the blobs that surround the "dark red"
>> blob that you are concerned about ?
>>
>> Just by looking at the image: blobs_ws03.tif
>>
>> it is not obvious which of the blobs is the one that doesn't seem to
>> produce the correct output.
>>
>>
>> Pixel coordinates (or an annotated image) will be very helpful too...
>>
>>
>>       Thanks
>>
>>
>>             Luis
>>
>>
>> --------------------------------------------
>> On Sun, Jul 26, 2009 at 4:09 PM, <lynx.abraxas at freenet.de> wrote:
>>
>> > Dear Dan Mueller,
>> >
>> >
>> > Thank You for Your quick reply with the examples.
>> > What   I   still   wonder   is   why   I   don't   get   2   when  I  ask
>> >  the
>> > SignedDanielssonDistanceMap for squared  distance  output.  Squared
>> >  distances
>> > should  be  always  integers  (if  I'm  not mistaken) and should go in the
>> > tif
>> > unmodified (eg. 2).
>> > Anyway, I changed my intermediat pixel format to float and  the  output  of
>> >  a
>> > single white pixel is as I'd expect.
>> > However  if I run my little watershed test program there is one blob (dark
>> > red
>> > blobl in blobs_ws03.tif) that is surrounded by four split blobs but itself
>> >  is
>> > not  split  although  it  has some crease. I even made the effort to count
>> > the
>> > pixels by hand. The  minima-line  is  8  pixels  off  the  rim  in
>> >  horizontal
>> > direction.  Now  accounting  for the additional distance to the left up to
>> > the
>> > end of the minima-line I'd say the gray values should decrease  further
>> >  since
>> > the  distanc  to the left has to be added to the 8 pixels up or down.But
>> > still
>> > blobs_rm01.tif has just one minimum. Are my expectations wrong here?
>> > I ran my test prog like this for the pics in the tbz  (h-min  height=  0,
>> >  all
>> > fully connectd):
>> > watershed05b blobs.tif blobs_sddm_01.vtk blobs_hm01.tif blobs_rm01.tif
>> > blobs_cc01.tif blobs_ws01.tif blobs_ws02.tif blobs_ws03.tif 0 1 1
>> >
>> >
>> > Thanks for hints or help
>> > Lynx
>> >
>> >
>> > On 26/07/09 15:33:53, Dan Mueller wrote:
>> > > 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
>> >
>> >
>> >
>> >
>> >
>> >
>> > _____________________________________
>> > Powered by www.kitware.com
>> >
>> > Visit other Kitware open-source projects at
>> > http://www.kitware.com/opensource/opensource.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
>> >
>> >
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.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
>
>


More information about the Insight-users mailing list