<meta http-equiv="content-type" content="text/html; charset=utf-8"><div><div class="gmail_quote">On Sun, Nov 14, 2010 at 5:42 AM, Dawood Masslawi <span dir="ltr"><<a href="mailto:davoud_zzz@yahoo.com">davoud_zzz@yahoo.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><table cellspacing="0" cellpadding="0" border="0"><tbody><tr><td valign="top" style="font:inherit"><span style="font-family:'Times New Roman';font-size:medium"><pre>
David,</pre><pre><br></pre><pre>The iterator.IsAtEnd(); command is correct and is not the cause of</pre><pre><br></pre><pre>the crash but the fact that you are activating the offsets without</pre><pre><br></pre><pre>boundary checking can cause errors when you iterate over out of bound</pre>
<pre><br></pre><pre>pixels. To handle the boundary pixels more efficiently you should use</pre><pre><br></pre><pre>the FaceList which divides the image into boundary and non-boundary</pre><pre><br></pre><pre>regions so you won't have to check for boundaries. I took the liberty</pre>
<pre><br></pre><pre>of editing your code and also placed some comments, hope that
helps.</pre><pre><br></pre><pre>regards,</pre><pre><br></pre><font color="#888888"><pre>Dawood</pre></font></span></td></tr></tbody></table></blockquote><div><br></div><div>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)?</div>
<div><br></div><div>Can you explain why this still crashes?</div><meta http-equiv="content-type" content="text/html; charset=utf-8"><a href="http://www.vtk.org/Wiki/ITK/Examples/Broken/Images/ShapedNeighborhoodIterator">http://www.vtk.org/Wiki/ITK/Examples/Broken/Images/ShapedNeighborhoodIterator</a><div>
<br></div><div><a href="http://www.vtk.org/Wiki/ITK/Examples/Broken/Images/ShapedNeighborhoodIterator"></a>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.</div>
<div><br></div><div>Thanks for your help so far,</div><div><br></div><div>David </div></div></div>