[Insight-users] ShapedNeighborhoodIterator SetNeighborhood

David Doria daviddoria at gmail.com
Tue Apr 19 10:07:46 EDT 2011


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


More information about the Insight-users mailing list