<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>
<BR>
I am trying to use the FastMarchingImageFilter to compute the distance map of a canny edge image. I could get correct distance map when I follow the example - just give one seed point. However, when I add all the none zero points(about 9000 points) in the canny image as seeds, the program becomes very slow and the result does not look like a correct distance map. Is there any one who could help about this?<BR>
<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> seeds->Initialize();<BR>
NodeType node;<BR> const double seedValue = 0.0;<BR> int num_seeds = 0;<BR>
// If we only use one seed as below, we get the correct distance map of that point.<BR> /* <BR> OutputImageType::IndexType seedPosition;<BR> seedPosition[0] = 100;<BR> seedPosition[1] = 100;<BR> node.SetValue( seedValue );<BR> node.SetIndex( seedPosition );<BR> seeds->InsertElement(num_seeds++, node );<BR>
<BR>*/<BR>
<BR>
// If we use all the nonzeros points in the canny edge image as seeds,we can not get correct distance map and the program is slow. <BR>
<BR> for (int i = 0; i< (image->w());i++)<BR> for (int j = 0; j< (image->h());j++)<BR> {<BR> OutputImageType::IndexType seedPosition;<BR> seedPosition[0] = i;<BR> seedPosition[1] = j;<BR> <BR> if ( (CannyFilter->GetOutput()->GetPixel(seedPosition))>0)<BR> {<BR> node.SetValue( seedValue );<BR> node.SetIndex( seedPosition );<BR> seeds->InsertElement(num_seeds++, node );<BR> }<BR> }<BR>
fastMarching->SetTrialPoints( seeds );<BR> fastMarching->SetSpeedConstant(1.0);<BR> fastMarching->SetOutputSize( CannyFilter->GetOutput()->GetBufferedRegion().GetSize() );<BR> fastMarching->SetOutputOrigin ( CannyFilter->GetOutput()->GetOrigin());<BR> fastMarching->SetOutputSpacing ( CannyFilter->GetOutput()->GetSpacing());<BR> <BR>
const double stoppingTime = max(image->w(),image->h()); <BR> fastMarching->SetStoppingValue( stoppingTime );<BR>
<BR>
FileWriterType::Pointer writer4 = FileWriterType::New();<BR> writer4->SetFileName("distance.jpg");<BR> writer4->UseCompressionOn();<BR> <BR> rescaleFilter->SetOutputMinimum( 0 );<BR> rescaleFilter->SetOutputMaximum( 255 );<BR> rescaleFilter->SetInput( fastMarching->GetOutput() );<BR> floatToUnsignedCharFilter ->SetInput( rescaleFilter->GetOutput() );<BR> writer4->SetInput( floatToUnsignedCharFilter->GetOutput() );<BR> <BR> try<BR> {<BR> writer4->Update();<BR> writer4->DebugOn();<BR> }<BR> catch (itk::ExceptionObject &e)<BR> {<BR> std::cerr << e << std::endl;<BR> }<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 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 Ding</STRONG></FONT><BR></DIV></BLOCKQUOTE></DIV><BR><BR><BR>
<BR>> Date: Thu, 1 Oct 2009 13:41:21 -0400<BR>> From: mike.jackson@bluequartz.net<BR>> To: insight-users@itk.org<BR>> Subject: [Insight-users] Threaded Gaussian Filter<BR>> <BR>> Anyone have a threaded version of the Gaussian Filter? I am currently<BR>> using the example code for a Gaussian filter from the ITK distribution<BR>> and for the image size I am throwing at it, the iteration loop takes a<BR>> long time because it performs the filter serially on every pixel.<BR>> <BR>> Thanks<BR>> _________________________________________________________<BR>> Mike Jackson mike.jackson@bluequartz.net<BR>> BlueQuartz Software www.bluequartz.net<BR>> Principal Software Engineer Dayton, Ohio<BR>> _____________________________________<BR>> Powered by www.kitware.com<BR>> <BR>> Visit other Kitware open-source projects at<BR>> http://www.kitware.com/opensource/opensource.html<BR>> <BR>> Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ<BR>> <BR>> Follow this link to subscribe/unsubscribe:<BR>> 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>