<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
<BR>
<P><BR>Dear all,<BR>
&nbsp;<BR>
I am trying to use the FastMarchingImageFilter to compute the distance map of a canny edge image.&nbsp;I could get correct&nbsp;distance map when&nbsp;I&nbsp;follow the example&nbsp;- just give one seed point. However, when I&nbsp;add all the none zero points(about 9000 points) in the canny image as seeds,&nbsp;the&nbsp;program becomes&nbsp;very slow and the result does not look like a correct distance map. Is there any one who could help about this?<BR>
&nbsp;<BR>
Thanks a lot.<BR><BR>
<DIV>
<TABLE id=HB_Mail_Container border=0 cellSpacing=0 cellPadding=0 width="100%" height="100%">
<TBODY>
<TR height="100%">
<TD id=HB_Focus_Element height=250 vAlign=top background="" width="100%">
//////////////////////////////////////////////////////<BR>&nbsp;seeds-&gt;Initialize();<BR>
&nbsp;NodeType node;<BR>&nbsp;const double seedValue = 0.0;<BR>&nbsp;int num_seeds = 0;<BR>
// If we only use one seed as below, we get the correct distance map of&nbsp;that&nbsp;point.<BR>&nbsp;/*&nbsp;<BR>&nbsp;OutputImageType::IndexType&nbsp; seedPosition;<BR>&nbsp;seedPosition[0] = 100;<BR>&nbsp;seedPosition[1] = 100;<BR>&nbsp;node.SetValue( seedValue );<BR>&nbsp;node.SetIndex( seedPosition );<BR>&nbsp;seeds-&gt;InsertElement(num_seeds++, node );<BR>
<BR>*/<BR>
&nbsp;<BR>
// If we use all the nonzeros points in the canny edge image as seeds,we&nbsp;can not get correct distance map and the program is slow. <BR>
<BR>&nbsp;for (int i = 0; i&lt; (image-&gt;w());i++)<BR>&nbsp;&nbsp;for (int j = 0; j&lt; (image-&gt;h());j++)<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;OutputImageType::IndexType&nbsp; seedPosition;<BR>&nbsp;&nbsp;&nbsp;seedPosition[0] = i;<BR>&nbsp;&nbsp;&nbsp;seedPosition[1] = j;<BR>&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;if ( (CannyFilter-&gt;GetOutput()-&gt;GetPixel(seedPosition))&gt;0)<BR>&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;node.SetValue( seedValue );<BR>&nbsp;&nbsp;&nbsp;&nbsp;node.SetIndex( seedPosition );<BR>&nbsp;&nbsp;&nbsp;&nbsp;seeds-&gt;InsertElement(num_seeds++, node );<BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;}<BR>
&nbsp;fastMarching-&gt;SetTrialPoints(&nbsp; seeds&nbsp; );<BR>&nbsp;fastMarching-&gt;SetSpeedConstant(1.0);<BR>&nbsp;fastMarching-&gt;SetOutputSize(&nbsp; CannyFilter-&gt;GetOutput()-&gt;GetBufferedRegion().GetSize() );<BR>&nbsp;fastMarching-&gt;SetOutputOrigin ( CannyFilter-&gt;GetOutput()-&gt;GetOrigin());<BR>&nbsp;fastMarching-&gt;SetOutputSpacing ( CannyFilter-&gt;GetOutput()-&gt;GetSpacing());<BR>&nbsp;<BR>
const double stoppingTime = max(image-&gt;w(),image-&gt;h());&nbsp;&nbsp;<BR>&nbsp;fastMarching-&gt;SetStoppingValue(&nbsp; stoppingTime&nbsp; );<BR>
&nbsp;<BR>
FileWriterType::Pointer writer4 = FileWriterType::New();<BR>&nbsp;&nbsp;&nbsp; writer4-&gt;SetFileName("distance.jpg");<BR>&nbsp;&nbsp;&nbsp; writer4-&gt;UseCompressionOn();<BR>&nbsp; <BR>&nbsp;rescaleFilter-&gt;SetOutputMinimum(&nbsp;&nbsp; 0 );<BR>&nbsp;rescaleFilter-&gt;SetOutputMaximum( 255 );<BR>&nbsp;rescaleFilter-&gt;SetInput(&nbsp; fastMarching-&gt;GetOutput()&nbsp; );<BR>&nbsp;floatToUnsignedCharFilter -&gt;SetInput( rescaleFilter-&gt;GetOutput() );<BR>&nbsp;writer4-&gt;SetInput( floatToUnsignedCharFilter-&gt;GetOutput() );<BR>&nbsp;&nbsp;&nbsp; &nbsp;<BR>&nbsp;try<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;writer4-&gt;Update();<BR>&nbsp;&nbsp;writer4-&gt;DebugOn();<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; catch (itk::ExceptionObject &amp;e)<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp; &nbsp;&nbsp;std::cerr &lt;&lt; e &lt;&lt; std::endl;<BR>&nbsp;&nbsp;&nbsp; }<BR></TD></TR>
<TR>
<TD style="FONT-SIZE: 1pt" height=1>
<DIV id=hotbar_promo></DIV></TD></TR></TBODY></TABLE>
<BLOCKQUOTE id=432e9af7>
<DIV>
<FONT color=#006600 face="Lucida Handwriting, Cursive"><STRONG>Best,</STRONG></FONT><BR>
<FONT color=#006600 face="Lucida Handwriting, Cursive"><STRONG>Siyi&nbsp;Ding</STRONG></FONT><BR></DIV></BLOCKQUOTE></DIV>
<BR><BR><BR>
<DIV>
<TABLE id=HB_Mail_Container border=0 cellSpacing=0 cellPadding=0 width="100%" height="100%">
<TBODY>
<TR height="100%">
<TD id=HB_Focus_Element height=250 vAlign=top background="" width="100%"></TD></TR>
<TR>
<TD style="FONT-SIZE: 1pt" height=1>
<DIV id=hotbar_promo></DIV></TD></TR></TBODY></TABLE>
<BLOCKQUOTE id=432e9af7>
<DIV>
<P><FONT color=#006600 face="Lucida Handwriting, Cursive"><STRONG>Best,</STRONG></FONT><BR>
<FONT color=#006600 face="Lucida Handwriting, Cursive"><STRONG>Sylvia Siyi&nbsp;Ding</STRONG></FONT><BR></DIV></BLOCKQUOTE></DIV><BR><BR><BR>&nbsp;
<BR>&gt; Date: Thu, 1 Oct 2009 13:41:21 -0400<BR>&gt; From: mike.jackson@bluequartz.net<BR>&gt; To: insight-users@itk.org<BR>&gt; Subject: [Insight-users] Threaded Gaussian Filter<BR>&gt; <BR>&gt; Anyone have a threaded version of the Gaussian Filter? I am currently<BR>&gt; using the example code for a Gaussian filter from the ITK distribution<BR>&gt; and for the image size I am throwing at it, the iteration loop takes a<BR>&gt; long time because it performs the filter serially on every pixel.<BR>&gt; <BR>&gt; Thanks<BR>&gt; _________________________________________________________<BR>&gt; Mike Jackson mike.jackson@bluequartz.net<BR>&gt; BlueQuartz Software www.bluequartz.net<BR>&gt; Principal Software Engineer Dayton, Ohio<BR>&gt; _____________________________________<BR>&gt; Powered by www.kitware.com<BR>&gt; <BR>&gt; Visit other Kitware open-source projects at<BR>&gt; http://www.kitware.com/opensource/opensource.html<BR>&gt; <BR>&gt; Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ<BR>&gt; <BR>&gt; Follow this link to subscribe/unsubscribe:<BR>&gt; http://www.itk.org/mailman/listinfo/insight-users<BR>                                               <br /><hr />Lauren found her dream laptop. <a href='http://www.microsoft.com/windows/choosepc/?ocid=ftp_val_wl_290' target='_new'>Find the PC that’s right for you.</a></body>
</html>