On 2/12/07, <b class="gmail_sendername">Pui Yu Lau</b> &lt;<a href="mailto:pyl111@rogers.com">pyl111@rogers.com</a>&gt; wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi everyone,<br><br>&nbsp;&nbsp;&nbsp;&nbsp;Thanks for the help in regards to the previous email.&nbsp;&nbsp;I sent a<br>followup email on a further problem, which may have been deleted from<br>the user list because I realized I started talking about vtk functions,
<br>thinking they were itk.&nbsp;&nbsp;Anyways, I&#39;m hoping someone can help me in my<br>problem:<br><br>I am attempting to segment certain anatomical structures from 3D images<br>that have been sliced.&nbsp;&nbsp;I&#39;m segmenting the structures using
<br>GeodesicActiveContour.&nbsp;&nbsp;However, at the end of the geodesicactivecontour<br>filter, I am left with a black and white image due to the binary<br>filter.&nbsp;&nbsp;I was wondering if there was any way I can extract the contour<br>
of my structure, then use the contour and apply it to my original<br>greyscale image (so it won&#39;t be black and white) and isolate the<br>structure, while keeping the rest of the image in black, for example.</blockquote>
<div><br>Sounds like a simple mask filter will do.. What exactly do you want here ? Try reading the software guide to be a bit more familiar with the suite of image processing algorithms available at your fingre tips<br></div>
<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> My main focus is on getting the contour extraction, and I have been<br>recommended to look for some sort of morphological filter.&nbsp;&nbsp;Through the
<br>ITK guide, I looked up the binary and greyscale filters from the<br>mathematical morphology as well as section 7.6 on extracting regions,<br>but I cannot seem to find functions to do what I want.&nbsp;&nbsp;I was wondering<br>if anyone has any idea on what I may have overlooked or for suggestions
<br>on tackling my problem differently.<br><br>- PY<br><br><br>Luis Ibanez wrote:<br><br>&gt;<br>&gt; Hi Pui,<br>&gt;<br>&gt; Please read carefully the description of this filter<br>&gt; in the ITK Software Guide.<br>&gt;
<br>&gt;&nbsp;&nbsp; <a href="http://www.itk.org/ItkSoftwareGuide.pdf">http://www.itk.org/ItkSoftwareGuide.pdf</a><br>&gt;<br>&gt; You seem to have missed many of the important feature<br>&gt; of the example. It may be convenient for you to read
<br>&gt; the previous sections on Level Sets. In particular the<br>&gt; section on the FastMarching filter and the ShapeDetection<br>&gt; filter.<br>&gt;<br>&gt;<br>&gt; The source code of the GeodesicActiveContour example
<br>&gt; is available at:<br>&gt;<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Insight/Code/Segmentation/<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GeodesicActiveContourImageFilter.cxx<br>&gt;<br>&gt;<br>&gt; In lines 319-320 you will find:<br>&gt;<br>&gt;&nbsp;&nbsp; geodesicActiveContour-&gt;SetInput(&nbsp;&nbsp;fastMarching-&gt;GetOutput() );
<br>&gt;&nbsp;&nbsp; geodesicActiveContour-&gt;SetFeatureImage( sigmoid-&gt;GetOutput() );<br>&gt;<br>&gt;<br>&gt; Where the SetInput() method is setting the initial level set<br>&gt; to be used by the GeodesicActiveContour filter. This initial
<br>&gt; level set is computed in this particular case, as the output<br>&gt; of a FastMarching image filter that is feed only with seed point.<br>&gt; The fast marching filter in this case is simply producing a<br>&gt; set of circles (or sphere) around the seed points.
<br>&gt;<br>&gt; The SetFeatureImage() is connecting the image that is going<br>&gt; to be used for computing the speed image. This feature image<br>&gt; is computed as the sigmoid mapping of the gradient magnitude<br>&gt; image.&nbsp;&nbsp;The goal is to have an image that has low (dark) value
<br>&gt; in the edges where you want your level set to stop, and high<br>&gt; (bright) values in the regions where you want the level set to<br>&gt; propagate rapidly.<br>&gt;<br>&gt;<br>&gt; The command line parameters passed to the example are described
<br>&gt; in lines 128-137:<br>&gt;<br>&gt;&nbsp;&nbsp; if( argc &lt; 10 )<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; std::cerr &lt;&lt; &quot;Missing Parameters &quot; &lt;&lt; std::endl;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; std::cerr &lt;&lt; &quot;Usage: &quot; &lt;&lt; argv[0];
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; std::cerr &lt;&lt; &quot; inputImage&nbsp;&nbsp;outputImage&quot;;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; std::cerr &lt;&lt; &quot; seedX seedY InitialDistance&quot;;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; std::cerr &lt;&lt; &quot; Sigma SigmoidAlpha SigmoidBeta&quot;;<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; std::cerr &lt;&lt; &quot; PropagationScaling&quot;&nbsp;&nbsp;&lt;&lt; std::endl;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; return 1;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&gt;<br>&gt;<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;a) Input image (the image to be segmented<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;b) Ouput image (segmentation resulting from the level set)
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;c) (x,y) index coordinates of the seed point for FastMarching<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;d) initial distance for fast marcing<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;e) Sigma for the smoothing of the gradient magnitude filter<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;f) Alpha and Beta parameters of the Sigmoid
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;g) Propagation scaling parameter for the Geodesic Active contour<br>&gt;<br>&gt;<br>&gt;<br>&gt; In general the initial level set image could be *any* rough<br>&gt; segmentation of the object. You could produce such initial
<br>&gt; segmentation by a manual delineation, a quick region growing<br>&gt; algorithm or a simple thresholding.<br>&gt;<br>&gt; It is quite common to implement two-stage segmentation methods<br>&gt; where the first stage only produces a quick and dirty segmentation,
<br>&gt; that is then passed to a second stage where a level set method will<br>&gt; fine tune the segmentatino. Note that level sets cannot perform<br>&gt; magic on a poor initial segmentation. It is at least desirable for
<br>&gt; the initial segmentation to be close to the edges of the object<br>&gt; to be segmented.<br>&gt;<br>&gt;<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Regards,<br>&gt;<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Luis<br>&gt;<br>&gt;<br>&gt; ==================
<br>&gt; Pui Yu Lau wrote:<br>&gt;<br>&gt;&gt; Hi,<br>&gt;&gt;<br>&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;I&#39;m a new user to ITK, and I&#39;ve been trying to learn to use some<br>&gt;&gt; of the segmentation filters.&nbsp;&nbsp;I&#39;ve been looking at the Geodesic
<br>&gt;&gt; Active Contour method, and I am confused on how it actually works.<br>&gt;&gt; Looking through the guide, it seems that it takes two initial image<br>&gt;&gt; inputs, where the first one is the initial level set, and the second
<br>&gt;&gt; is the feature image.&nbsp;&nbsp;However, when running the example of<br>&gt;&gt; GeodesicActiveContourImageFilter, the images used were<br>&gt;&gt; BrainProtonDensitySlice.png and<br>&gt;&gt; GeodesicActiveContourImageFilterOutput.png
, where the latter does not<br>&gt;&gt; exist.&nbsp;&nbsp;So, my question is, in this case, is the<br>&gt;&gt; BrainProtonDensitySlice the feature image (input), while the<br>&gt;&gt; GeodesicActiveContourImageFilterOutput is the initial level set
<br>&gt;&gt; (output)?&nbsp;&nbsp;If not, what exactly is the initial level set image?<br>&gt;&gt;<br>&gt;&gt; - PY<br>&gt;&gt;<br>&gt;&gt; _______________________________________________<br>&gt;&gt; Insight-users mailing list<br>&gt;&gt; 
<a href="mailto:Insight-users@itk.org">Insight-users@itk.org</a><br>&gt;&gt; <a href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</a><br>&gt;&gt;<br>&gt;<br>&gt;<br>
<br><br>_______________________________________________<br>Insight-users mailing list<br><a href="mailto:Insight-users@itk.org">Insight-users@itk.org</a><br><a href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users
</a><br></blockquote></div><br><br clear="all"><br>-- <br>Karthik Krishnan<br>R&amp;D Engineer,<br>Kitware Inc.