<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
Hi, Ghassan<BR><BR>Thanks for the advice. I flip the input.<BR>The result now is both inside and outside are positive :(<BR><BR>I use float type as the filteroutput instead of "unsigned short" in the example. I also tried unsigned short, the result is the same.<BR>
<BR>
Here is part of my code. <BR>
////////////////////////////////////////////////////////////////////////////////////////////////////<BR>
typedef itk::Image< unsigned char, 2 > BinaryImageType;<BR>
typedef itk::Image< float , 2> LSVImageType;<BR>
typedef itk::SignedDanielssonDistanceMapImageFilter < BinaryImageFilter, LSVImageFilter > FilterType;<BR>
FilterType::Pointer filter = FilterType::New();<BR>
<BR>
filter ->SetInput ( contour ); // contour is the binary image with BinaryImageType, 1 at boundary points, and 0 elsewhere.<BR>
<BR>
LSVImageFilter::Pointer LSVImage = filter->GetDistanceMap();<BR>
<BR>
Display (LSVImage) // this is a function that displays the image.<BR>
//////////////////////////////////////////////////////////////////////////////////////////////////////<BR>
<BR>
I notice when I cout<<LSV_image->GetBufferedRegion().GetSize() , the output is [0,0]. I guess there is something wrong in my code that causes this weird output size. I can display LSVImage, although both inside and outside region are postive.<BR>
<BR>
<BR>Thanks for any input<BR>Siqi<BR><BR>> CC: insight-users@itk.org<BR>> From: hamarneh@gmail.com<BR>> To: pidanchen@hotmail.com<BR>> Subject: Re: [Insight-users] SignedDanielssonDistanceMapImageFilter<BR>> Date: Tue, 9 Dec 2008 20:45:19 -0800<BR>> <BR>> Hello Siqi,<BR>> <BR>> You write: "The input is only a binary image with boundary points at <BR>> 0, and all other points at 1."<BR>> However, according to he documentation: "As a convention, the distance <BR>> is evaluated from the boundary of the ON pixels."<BR>> (from http://www.itk.org/Doxygen/html/classitk_1_1SignedDanielssonDistanceMapImageFilter.html <BR>> )<BR>> So, your input image should have boundary pixels set to 1 and all <BR>> other points to 0 (and not the other way around).<BR>> HTH,<BR>> /Ghassan<BR>> <BR>> <BR>> <BR>> On 9-Dec-08, at 7:24 PM, chensiqi wrote:<BR>> <BR>> ><BR>> > Hi, ITKers<BR>> ><BR>> > I got two questions regarding SignedDanielssonDistanceMapImageFilter.<BR>> ><BR>> > 1. The result I have is not "signed", both the inside and outside <BR>> > distance values are negative. The input is only a binary image with <BR>> > boundary points at 0, and all other points at 1. I was wondering <BR>> > how I was wondering how SignedDanielssonDistanceMapImageFilter <BR>> > determine the region of inside and outside.<BR>> ><BR>> > 2. In Examples of SignedDanielssonDistanceMapImageFilter. cxx, I <BR>> > notice that the OutputImageType of filter is unsigned short, which I <BR>> > don't quite understand. The output should contains both negative <BR>> > and positive distance, why use "unsigned" here?<BR>> ><BR>> > Thanks<BR>> > Siqi<BR>> ><BR>> > MSN保护盾,十八般武艺保障MSN安全! 现 <BR>> > 在就下载! _______________________________________________<BR>> > Insight-users mailing list<BR>> > Insight-users@itk.org<BR>> > http://www.itk.org/mailman/listinfo/insight-users<BR>> <BR><BR><br /><hr />MSN热搜榜全新升级,更多排行榜等着你! <a href=' http://top.msn.com.cn' target='_new'>立即查看!</a></body>
</html>