I'm not familiar with ShapedNeighborhood but I know you can just use a regular NeighborhoodIterator and set the radius as follows to generate a 2D box:<div><br></div><div>radius[0] = 3;</div><div>radius[1] = 3;</div><div>
radius[2] = 0;</div><div><br></div><div>- Neil<br><br><div class="gmail_quote">On Tue, Apr 19, 2011 at 10:07 AM, David Doria <span dir="ltr"><<a href="mailto:daviddoria@gmail.com">daviddoria@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">I tried to set the neighborhood to a box by using this:<br>
<br>
typedef itk::FlatStructuringElement<2> StructuringElementType;<br>
StructuringElementType::RadiusType elementRadius;<br>
elementRadius.Fill(3);<br>
StructuringElementType structuringElement =<br>
StructuringElementType::Box(elementRadius);<br>
<br>
typedef itk::ShapedNeighborhoodIterator<ImageType> IteratorType;<br>
IteratorType iterator(radius, image, image->GetLargestPossibleRegion());<br>
iterator.SetNeighborhood(structuringElement);<br>
<br>
But it complains on this line:<br>
<br>
iterator.SetNeighborhood(structuringElement);<br>
<br>
Shouldn't this work since FlatStructuringElement is derived from Neighborhood?<br>
<br>
Thanks,<br>
<br>
David<br>
_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
</blockquote></div><br></div>