<div class="gmail_quote">On Thu, Apr 21, 2011 at 8:15 AM, Rashindra Manniesing <span dir="ltr">&lt;<a href="mailto:rashindra@gmail.com">rashindra@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><br></div><div>Need some help here!</div><div><br></div><div>How to properly use the neighborhood iterators on vector images using ZeroFluxNeumannCondition (using ITK 3.20.0) ?</div><div><br></div><div>Currently I am doing this, but it gives memory error on running (probably because the vector length is unknown in the typedef), see code below. In the last line, the program fails. The ConstNeighborhoodIterators have default ZeroFluxNeumann. </div>


<div><br></div><div>Many thanks, Rashindra</div><div><br></div><div><br></div><div>typedef VectorImage&lt;&gt; VT;</div><div>typedef ConstNeighborhoodIterator&lt;VT&gt; NT</div><div><br></div><div>NT::RadiusType radius;</div>


<div>radius.Fill();</div><div><br></div><div>NT iter (rad, img, img-&gt;GetLargestPossibleRegion());</div><div>iter.GoToBegin();</div><div>iter.GetNeighborhood();</div></blockquote><div><br>It seems to work fine for me:<br>
<a href="http://www.vtk.org/Wiki/ITK/Examples/VectorImages/NeighborhoodIterator">http://www.vtk.org/Wiki/ITK/Examples/VectorImages/NeighborhoodIterator</a><br><br>David <br></div></div>