<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><br> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;">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></body></html>