[Insight-users] ShapedNeighborhoodIterator SetNeighborhood

Neil Panjwani paniwani at gmail.com
Tue Apr 19 11:07:14 EDT 2011


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:

radius[0] = 3;
radius[1] = 3;
radius[2] = 0;

- Neil

On Tue, Apr 19, 2011 at 10:07 AM, David Doria <daviddoria at gmail.com> wrote:

> I tried to set the neighborhood to a box by using this:
>
>  typedef itk::FlatStructuringElement<2> StructuringElementType;
>  StructuringElementType::RadiusType elementRadius;
>  elementRadius.Fill(3);
>  StructuringElementType structuringElement =
> StructuringElementType::Box(elementRadius);
>
>  typedef itk::ShapedNeighborhoodIterator<ImageType> IteratorType;
>  IteratorType iterator(radius, image, image->GetLargestPossibleRegion());
>  iterator.SetNeighborhood(structuringElement);
>
> But it complains on this line:
>
> iterator.SetNeighborhood(structuringElement);
>
> Shouldn't this work since FlatStructuringElement is derived from
> Neighborhood?
>
> Thanks,
>
> David
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110419/fee1a8a9/attachment.htm>


More information about the Insight-users mailing list