<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span>Thank you for your reply, Kent. I have been trying that with little success. Anyways, I'm investigating change my input to the Sobel.&nbsp; So let's c.</span></div><div><br><span></span></div><div><span>regards,</span></div><div><span>Emma<br></span></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;"> <div dir="ltr"> <font face="Arial" size="2"> <hr size="1">  <b><span style="font-weight:bold;">From:</span></b> Kent Ogden &lt;ogdenk@upstate.edu&gt;<br> <b><span style="font-weight: bold;">To:</span></b> Emma Ryan &lt;eryanvtk@yahoo.com&gt; <br> <b><span style="font-weight: bold;">Sent:</span></b> Friday, March 16, 2012 5:36 AM<br> <b><span style="font-weight:
 bold;">Subject:</span></b> Re: [Insight-users] Sobel operator gives fat edges<br> </font> </div> <br>
<div id="yiv806035005">
  

  
  <div>
    <div style="margin-top:0;margin-bottom:0;">
      <font face="Times New Roman" size="5">Emma,</font>    </div>
<br>      
    <div style="margin-top:0;margin-bottom:0;">
      <font face="Times New Roman" size="5">You could try applying an erosion filter to thin the edge. &nbsp;You have to be careful, it could 'erode' all the way through and break the connectivity. &nbsp;I'm not an ITK expert, but I'm sure there is an erosion filter in there somewhere, that's a very basic image processing algorithm (complemented by dilation, so you will hear them together sometimes, as in erosion/dilation).</font>    </div>
<br>      
    <div style="margin-top:0;margin-bottom:0;">
      <font face="Times New Roman" size="5">Kent</font>    </div>
<br>      
    <div style="margin-top:0;margin-bottom:0;">
      <br>
      <br>
      &gt;&gt;&gt; Emma Ryan &lt;eryanvtk@yahoo.com&gt; 3/15/2012 07:18 PM &gt;&gt;&gt;<br>    </div>
    <div style="background-color:#fff;font-family:times new roman, new york, times, serif;color:#000;font-size:12pt;">
      <div>
        <div style="margin-top:0;margin-bottom:0;">
          <span>Hi All,</span>        </div>
      </div>
      <div>
        <div style="margin-top:0;margin-bottom:0;">
          <br>
                  </div>
      </div>
      <div>
        <div style="margin-top:0;margin-bottom:0;">
          &nbsp;&nbsp; Any guesses as to how I can address this 'fat edge' issue.&nbsp; Or does anybody have an idea&nbsp; how Matlab manages to get the thin lines ?        </div>
      </div>
      <div>
        <div style="margin-top:0;margin-bottom:0;">
          <br>
                  </div>
      </div>
      <div>
        <div style="margin-top:0;margin-bottom:0;">
          Thank you,        </div>
      </div>
      <div>
        <div style="margin-top:0;margin-bottom:0;">
          Emma<br>        </div>
      </div>
      <div>
        <div style="margin-top:0;margin-bottom:0;">
          <span>&nbsp;&nbsp;&nbsp;<br></span>        </div>
      </div>
      <div>
        <div style="margin-top:0;margin-bottom:0;">
          <br>
                  </div>
      </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;">
          <div dir="ltr">
            <div style="margin-top:0;margin-bottom:0;">
              </div><hr size="1">
              <b><span style="font-weight:bold;">From:</span></b>&nbsp;Sergio Vera &lt;sergio.vera@alma3d.com&gt;<br><b><span style="font-weight:bold;">To:</span></b>&nbsp;Emma Ryan &lt;eryanvtk@yahoo.com&gt;<br><b><span style="font-weight:bold;">Cc:</span></b>&nbsp;"insight-users@itk.org" &lt;insight-users@itk.org&gt;<br><b><span style="font-weight:bold;">Sent:</span></b>&nbsp;Wednesday, March 14, 2012 1:22 AM<br><b><span style="font-weight:bold;">Subject:</span></b>&nbsp;Re: [Insight-users] Sobel operator gives fat edges<br>            
          </div>
          <div style="margin-top:0;margin-bottom:0;">
            <br>
                      </div>
          <div id="yiv806035005">
            <div style="margin-top:0;margin-bottom:0;">
              Have you tried CannyEdge Detection Filter? Canny always returns the thinnest edges.            </div>
            <div>
              <div style="margin-top:0;margin-bottom:0;">
                <br>
                              </div>
            </div>
            <div>
              <div style="margin-top:0;margin-bottom:0;">
                Hope to help Regards<br><br>              </div>
              <div class="yiv806035005gmail_quote">
                <div style="margin-top:0;margin-bottom:0;">
                  On Wed, Mar 14, 2012 at 2:59 AM, Emma Ryan <span dir="ltr">&lt;<a rel="nofollow" ymailto="mailto:eryanvtk@yahoo.com" target="_blank" href="mailto:eryanvtk@yahoo.com">eryanvtk@yahoo.com</a>&gt;</span>&nbsp;wrote:<br>                </div>
                <blockquote class="yiv806035005gmail_quote" style="margin-left:0;margin-top:0;border-left:1px #ccc solid;margin-right:0;margin-bottom:0;padding-left:0;">
                  <div>
                    <div style="font-family:times new roman, new york, times, serif;font-size:12pt;">
                      <div style="margin-top:0;margin-bottom:0;">
                        <br>
                                              </div>
                      <div style="font-family:times new roman, new york, times, serif;font-size:12pt;">
                        <div style="margin-top:0;margin-bottom:0;">
                          Hi ,<br><br>&nbsp;&nbsp; I am using the sobelOperator provided in itk.&nbsp; The following is my code snippet. I would like to understand<br><br>1.&nbsp; the default setting of the sobel and<br>2. how I can tune it. There dont seem to be too many member functions to manipulate the sobel.<br>3. If I need to use Erosion filter to thin the edges, how do I design a 'line' structuring element. My code ( also added below) does not seem to allow line (which I am guessing derives from Box, line = 1-D Box)<br><br>Any help/suggestions is truly appreciated.<br><br>Thank you,<br>Emma<br><br><br>typedef itk::ConstNeighborhoodIterator&lt;ImageType&gt; NeighborhoodIteratorType;<br>&nbsp;&nbsp;&nbsp; typedef itk::ImageRegionIterator&lt; ImageType&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IteratorType;<br><br>&nbsp;&nbsp;&nbsp; itk::SobelOperator&lt;PixelType, 2&gt; sobel;<br>&nbsp;&nbsp;&nbsp;
 sobel.SetDirection(1);&nbsp;<br>&nbsp;&nbsp;&nbsp; itk::Size&lt;2&gt; radius_s;<br>&nbsp;&nbsp;&nbsp; radius_s.Fill(1);<br>&nbsp;&nbsp;&nbsp; sobel.CreateToRadius(radius_s);<br><br>&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp; NeighborhoodIteratorType::RadiusType radius = sobel.GetRadius();<br>&nbsp;&nbsp;&nbsp; NeighborhoodIteratorType it( radius, my_image, my_image-&gt;GetRequestedRegion() );<br>&nbsp;&nbsp;&nbsp; itk::NeighborhoodInnerProduct&lt;ImageType&gt; inner_product;<br><br>&nbsp;&nbsp;&nbsp; ImageType::Pointer output = ImageType::New();<br>&nbsp;&nbsp;&nbsp; output-&gt;SetRegions(my_image-&gt;GetRequestedRegion());<br>&nbsp;&nbsp;&nbsp; output-&gt;Allocate();<br>&nbsp;<br>&nbsp;&nbsp;&nbsp; IteratorType out(output, my_image-&gt;GetRequestedRegion());<br>&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp; for (it.GoToBegin(), out.GoToBegin(); !it.IsAtEnd(); ++it, ++out)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;out.Set( inner_product( it, sobel )
 );<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; output-&gt;Update();<br>&nbsp;&nbsp;&nbsp;<br><br>//Erosion Structuring Element: The following fails to compile if I use '1' instead of '2'<br>typedef itk::FlatStructuringElement&lt;2&gt; StructuringElementType;<br>&nbsp;&nbsp;&nbsp; StructuringElementType::RadiusType element_radius;<br>&nbsp;&nbsp;&nbsp; element_radius.Fill(5);<br>&nbsp;<br>&nbsp;&nbsp;&nbsp; StructuringElementType strel = StructuringElementType::Box(element_radius);<br>                        </div>
                      </div>
                    </div>
                  </div>
                  <div style="margin-top:0;margin-bottom:0;">
                    <br>
                    _____________________________________<br>Powered by <a rel="nofollow" target="_blank" href="http://www.kitware.com">www.kitware.com</a><br><br>Visit other Kitware open-source projects at<br>http://www.kitware.com/opensource/opensource.html<br><br>Kitware offers ITK Training Courses, for more information visit:<br>http://www.kitware.com/products/protraining.php<br><br>Please keep messages on-topic and check the ITK FAQ at:<br>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>                  </div>
                </blockquote>
              </div>
              <div style="margin-top:0;margin-bottom:0;">
                <br>
                <br clear="all">
                              </div>
              <div>
                <div style="margin-top:0;margin-bottom:0;">
                  <br>
                                  </div>
              </div>
              <div style="margin-top:0;margin-bottom:0;">
                --<br>Sergio Vera<br><br>&nbsp;Alma IT Systems<br>&nbsp;C/ Vilana, 4B, 4º 1ª<br>&nbsp;08022 Barcelona<br>&nbsp;T. (+34) 932 380 592<br>&nbsp;<a rel="nofollow" target="_blank" href="http://www.alma3d.com">www.alma3d.com</a><br>              </div>
            </div>
          </div>
          <div style="margin-top:0;margin-bottom:0;">
            <br>
            <br>
          </div>
        </div>
      </div>
    </div>
  </div>


</div><br><br> </div> </div>  </div></body></html>