[Insight-users] ShapedNeighborhoodIterator problem

David Doria daviddoria at gmail.com
Sun Nov 14 08:17:08 EST 2010


On Sun, Nov 14, 2010 at 5:42 AM, Dawood Masslawi <masslawi at gmail.com>wrote:

> David,
>
>
> The iterator.IsAtEnd(); command is correct and is not the cause of
>
>
> the crash but the fact that you are activating the offsets without
>
>
> boundary checking can cause errors when you iterate over out of bound
>
>
> pixels. To handle the boundary pixels more efficiently you should use
>
>
> the FaceList which divides the image into boundary and non-boundary
>
>
> regions so you won't have to check for boundaries. I took the liberty
>
>
> of editing your code and also placed some comments, hope that
>  helps.
>
>
> regards,
>
>
> Dawood
>
>
Hm, I actually thought about that, that's why I had that "small region" code
(commented) in there. I have modified the code so that it is iterating over
a completely valid region of the image, and it still crashes. Also, the way
you activated the offsets would create a ball, not a cross, right (maybe not
in the R=1 case, but generally)?

Can you explain why this still crashes?
http://www.vtk.org/Wiki/ITK/Examples/Broken/Images/ShapedNeighborhoodIterator

<http://www.vtk.org/Wiki/ITK/Examples/Broken/Images/ShapedNeighborhoodIterator>In
the mean time, I'll look into the ImageBoundaryFacesCalculator. It seems
like since the shaped neighborhood iterator doesn't work yet on a manually
specified internal region that it would have same the same problem on the
first region (the internal region) in the FaceList that is computed. I'm
trying to get it working from the "ground up" before adding this additional
component.

Thanks for your help so far,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20101114/d7be8db7/attachment.htm>


More information about the Insight-users mailing list