<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span>Hello Juan,</span></div><div><br><span></span></div><div><span>Thank you again for your sincere answer.</span></div><div><br><span></span></div><div><span>That itk code called "</span>GeodesicActiveContourImageFilter.cxx" works well if I didn't change it, just using Fast Marching method to produce the level set as original. After my change, the initial contour is the result of another segmentation method, using thresholding, and the parameters I provided is as follows:</div><div><br></div><div>************<br></div><div>sigma = 1.0</div><div>sigmasoidAlpha = 1.0 <br></div><div>sigmasoidBeta = 1.0</div><div>propagationScaling = 5</div><div>************</div><div><br></div><div>And, the final screen gives out these parameters:</div><div><br></div><div>************</div>Max. no. iterations: 800<br>Max. RMS error:
 0.02<br>No. elpased iterations: 17<br>RMS change: 0.0166297<br>************<br><br>I changed the propagation scaling from 5 to 2, and it gives out these:<br><br>************<br>Max. no. iterations: 800<br>Max. RMS error: 0.02<br>No. elpased iterations: 16<br>RMS change: 0.00562183<br>************<br><br>How can I obtain a better result with these?<br><br>Looking forward to receive your helpful suggestions. Thanks in advance :) <br><br>Regards,<br>Abayiz<br><div><br></div><div><br></div><div><br></div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><font face="Arial" size="2"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> Juan Cardelino &lt;juan.cardelino@gmail.com&gt;<br><b><span style="font-weight: bold;">To:</span></b> Abayiz &lt;abayiz@yahoo.com&gt;<br><b><span style="font-weight: bold;">Cc:</span></b> itk
 &lt;insight-users@itk.org&gt;<br><b><span style="font-weight: bold;">Sent:</span></b> Monday, August 15, 2011 4:04 PM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [Insight-users] Use Initial Segmentation as Input Level-Set<br></font><br>Hello, Abayiz,<br><br>Thank you for the further details, however more work is required to<br>diagnose the problem.<br><br>The Geodesic Active Contour algorithm only moves the curve if you are<br>close to the object to detect. To solve that, it is usual to add a<br>constant inflation/deflation force that moves the front outwards or<br>inwards. So setting this parameter you should see the curve move,<br>unless of course you are already over the boundaries of the object of<br>interest. Have you checked that?<br>In ITK's jargon, the parameter that controls this propagation is<br>called propagation scaling.<br><br>In addition, trying with a simple binary example (even in 2d) could<br>also serve you to debug.
 Lets say, a white cube/square over a black<br>background and the initial contour being a sphere/circle outside the<br>cube using a deflation force.<br><br>How about the initial contour? Was it hand drawn? or is it the result<br>of another segmentation? Because a common mistake here is to invert<br>the initial level set and you could observe weird behaviours<br><br>What were the final parameters of the evolution? Number of iterations,<br>RMS error value?<br><br>Finally, you should look in the GeodesicActiveContourImageFilter<br>example, where an observer is attached to the filter. This observer is<br>helpful to show how the curve evolves, you could show the current<br>number of iteration and the actual RMS change value.<br><br>Try to provide answers for all these questions and show here their results.<br>HTH.<br>Best,<br>&nbsp; &nbsp; &nbsp; &nbsp;  Juan<br><br>On Mon, Aug 15, 2011 at 4:52 AM, Abayiz &lt;<a ymailto="mailto:abayiz@yahoo.com"
 href="mailto:abayiz@yahoo.com">abayiz@yahoo.com</a>&gt; wrote:<br>&gt; Hello,<br>&gt;<br>&gt; Thank you for your reply.<br>&gt; I just used the "GeodesicActiveContourImageFilter.cxx" in ITK to perform the<br>&gt; level-set segmentation. And I used a reader to read the initially segmented<br>&gt; data, then give that data as the input to the "GeodesicActiveContourFilter",<br>&gt; that is, in the original code, it was like:<br>&gt;<br>&gt; *****************<br>&gt; &nbsp; typedef&nbsp;&nbsp; float&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; InternalPixelType;<br>&gt; &nbsp; const&nbsp;&nbsp;&nbsp;&nbsp; unsigned int&nbsp;&nbsp;&nbsp; Dimension = 3;<br>&gt; &nbsp; typedef itk::Image&lt; InternalPixelType, Dimension &gt;&nbsp; InternalImageType;<br>&gt;<br>&gt; typedef&nbsp; itk::FastMarchingImageFilter&lt;<br>&gt;
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; InternalImageType,<br>&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; InternalImageType &gt;&nbsp;&nbsp;&nbsp; FastMarchingFilterType;<br>&gt; FastMarchingFilterType::Pointer&nbsp; fastMarching =<br>&gt; FastMarchingFilterType::New();<br>&gt; ...<br>&gt; geodesicActiveContour-&gt;SetInput(&nbsp; fastMarching-&gt;GetOutput() );<br>&gt; *****************<br>&gt; But, I changed it as:<br>&gt;<br>&gt; *****************<br>&gt; typedef&nbsp; itk::ImageFileReader&lt; InternalImageType &gt; ReaderType;<br>&gt; ReaderType::Pointer reader2 = ReaderType::New();<br>&gt; reader2-&gt;SetFileName( argv[10] );<br>&gt; geodesicActiveContour-&gt;SetInput(&nbsp;
 reader2-&gt;GetOutput() );<br>&gt; *****************<br>&gt; The code compiles, but the result is nothing but exactly the same as the<br>&gt; initially segmented data, which was read and given to the<br>&gt; "GeodesicActiveContourFilter", even if I changed several kinds of<br>&gt; parameters.<br>&gt;<br>&gt; Am I doing something wrong here??<br>&gt; Looking forward to receive your suggestions. Thanks in advance.<br>&gt;<br>&gt; Regards,<br>&gt; Abayiz<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt; ________________________________<br>&gt; From: Juan Cardelino &lt;<a ymailto="mailto:juan.cardelino@gmail.com" href="mailto:juan.cardelino@gmail.com">juan.cardelino@gmail.com</a>&gt;<br>&gt; To: Abayiz &lt;<a ymailto="mailto:abayiz@yahoo.com" href="mailto:abayiz@yahoo.com">abayiz@yahoo.com</a>&gt;<br>&gt; Cc: itk &lt;<a ymailto="mailto:insight-users@itk.org" href="mailto:insight-users@itk.org">insight-users@itk.org</a>&gt;<br>&gt; Sent:
 Monday, August 15, 2011 2:31 AM<br>&gt; Subject: Re: [Insight-users] Use Initial Segmentation as Input Level-Set<br>&gt;<br>&gt; On Sun, Aug 14, 2011 at 9:29 AM, Abayiz &lt;<a ymailto="mailto:abayiz@yahoo.com" href="mailto:abayiz@yahoo.com">abayiz@yahoo.com</a>&gt; wrote:<br>&gt;&gt; Hello,<br>&gt;&gt; I want to perform level-set segmentation using a set of already achieved<br>&gt;&gt; initially segmented 3D data. What I tried was giving the initial segmented<br>&gt;&gt; data as the output of the level-set filter&nbsp; (for instance instead of<br>&gt;&gt; giving<br>&gt;&gt; FastMarchingFilter-&gt;GetOutput(), I gave reader-&gt;GetOutput, after reading<br>&gt;&gt; the<br>&gt;&gt; data) . But it didn't work. How can I do this??<br>&gt;<br>&gt; Well I do exactly that and works, it is just a matter of details. If<br>&gt; you provide more information about how exactly do you implement it<br>&gt; maybe we can help you.<br>&gt; In addition, it would help if
 you also tell us what exactly "didn't<br>&gt; work means". It doesn't compile? The program crashes? It gives<br>&gt; unexpected output?<br>&gt; Please try to be more precise, we are not seeing your screen so we<br>&gt; can't possibly guess what is going on.<br>&gt;<br>&gt;<br>&gt;&gt; Sincerely thank you in advance!<br>&gt;&gt; Regards,<br>&gt;&gt; Abayiz<br>&gt;&gt;<br>&gt;&gt; _____________________________________<br>&gt;&gt; Powered by www.kitware.com<br>&gt;&gt;<br>&gt;&gt; Visit other Kitware open-source projects at<br>&gt;&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>&gt;&gt;<br>&gt;&gt; Kitware offers ITK Training Courses, for more information visit:<br>&gt;&gt; <a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>&gt;&gt;<br>&gt;&gt; Please keep messages on-topic and check the
 ITK FAQ at:<br>&gt;&gt; <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>&gt;&gt;<br>&gt;&gt; Follow this link to subscribe/unsubscribe:<br>&gt;&gt; <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>&gt;&gt;<br>&gt;&gt;<br>&gt;<br>&gt;<br>&gt;<br><br><br></div></div></div></body></html>