[Fwd: Re: [Insight-users] Signed distance map?] more explanations about 0.5 shift

karl at bwh.harvard.edu karl at bwh.harvard.edu
Thu Sep 30 08:41:09 EDT 2004



You can also check
http://lmi.bwh.harvard.edu/papers/pdfs/2004/krissianLMI04.pdf


Karl

---------------------------- Original Message ----------------------------
Subject: Re: [Insight-users] Signed distance map?
From:    karl at bwh.harvard.edu
Date:    Wed, September 29, 2004 2:10 pm
To:      "Zachary Pincus" <zpincus at stanford.edu>
Cc:      karl at bwh.harvard.edu
--------------------------------------------------------------------------


Zach,


You could apply twice the Danielsson distance,
let's say,
assuming the structure is 255 and the background is 0,
and that DanielssonDistance provides the distance to the set
of non-zero pixels (voxels):

// outside distance
d1 = DanielssonDistance(i>128)-0.5

// inside distance
d2 = DanielssonDistance(i<=128)-0.5


Resulting distance (if inside is negative for example):

distance= d1*(i<=128)-d2*(i>128)

Shifting by 0.5 allows to consider that the interface between inside and
outside in the middle between 2 pixels (or voxels).

Karl


> Karl,
>
> Thanks for your suggestions. I am actually thinking about coding up one
of these approaches as a signed distance filter to submit ITK, since it
appears that this is a common request. Clearly the best approach would
be to muck about with the Danielsson filter to make a signed variant a
la "The signed Euclidean distance transform and its applications" by QZ
Ye.
>
> However, I'm not sure I have the time nor the inclination to do that; if
I were to use one of the two-pass methods that you suggest below, which
would you recommend for accuracy? For computational speed? Also, I'm not
sure if I completely followed the reasoning behind your
> suggestion about shifting the Danielsson outputs by 0.5...
>
> Thanks,
>
> Zach Pincus
>
> Department of Biochemistry and Program in Biomedical Informatics
Stanford University School of Medicine
>
>
>
> On Sep 29, 2004, at 7:38 AM, karl at bwh.harvard.edu wrote:
>
>>
>>
>> Hi,
>>
>> You can use itkIsoContourDistanceImageFilter without a narrow band, and
then use itkFastChamferDistanceImageFilter without a narrow band on the
result,
>> this will give you an approximated (Chamfer) signed distance from the
isocontour that you choose.
>>
>> For example, if your image is binary (0 or 255), you can choose 128 as
the isocontour value:
>>
>> Parameters for IsoContourDistance:
>> LevelSetValue --> 128
>> FarValue --> higher than the maximal distance you want to compute
>>
>> Parameters for the Chamfer Distance:
>> input --> result of IsoContourDistance
>> MaximalDistance --> Maximal distance you want to compute
>>
>> itkIsoContourDistanceImageFilter will estimate the distance to the
isocontour only for the points very close to it,
>> itkFastChamferDistanceImageFiler will compute a signed Chamfer distance
based on the previous result.
>>
>> Hope this help,
>>
>> Karl Krissian
>>
>>
>> P.S.: another option is to run twice Danielsson distance, inside and
outside
>> and to shift the results by 0.5 for better accuracy.
>>
>>
>>
>>> Is there a class in ITK that produces a signed distance map from an
unsigned image (binary or otherwise)? The Danielsson map filter
doesn't
>>> seem to do so, and the IsoContourDistanceImageFilter requires a signed
level set image as an input.
>>>
>>> It's easy enough to do this with two applications of the Danielsson
filter on an image and its inverted pair, and subtract the results; I
was just wondering if there is already a class to do this.
>>>
>>> Thanks,
>>>
>>> Zach Pincus
>>>
>>> _______________________________________________
>>> Insight-users mailing list
>>> Insight-users at itk.org
>>> http://www.itk.org/mailman/listinfo/insight-users
>>>
>>
>>
>> _______________________________________________
>> Insight-users mailing list
>> Insight-users at itk.org
>> http://www.itk.org/mailman/listinfo/insight-users
>>
>
>







More information about the Insight-users mailing list