Thanks David.<div><br></div><div>The example works fine, copy pasting this into my own class, however gives memory error on calling Getneighborhood (for 3D vector images, with arbitary large number of vectorlength). Debugging revealed an error in the constructor of the VariableLengthVector of which its number of elements seems to be uninitialized. Probably something very wrong in my class, but unfortunately I have no time to figure this out to the bottom. I am going for a different solution, </div>
<div><br></div><div>Greetings Rashindra</div><div><br></div><div><br><div><br></div><div><br></div><div><br><br><div class="gmail_quote">On Thu, Apr 21, 2011 at 15:02, David Doria <span dir="ltr"><<a href="mailto:daviddoria@gmail.com" target="_blank">daviddoria@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="gmail_quote"><div>On Thu, Apr 21, 2011 at 8:15 AM, Rashindra Manniesing <span dir="ltr"><<a href="mailto:rashindra@gmail.com" target="_blank">rashindra@gmail.com</a>></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<> VT;</div><div>typedef ConstNeighborhoodIterator<VT> NT</div><div><br></div><div>NT::RadiusType radius;</div>
<div>radius.Fill();</div><div><br></div><div>NT iter (rad, img, img->GetLargestPossibleRegion());</div><div>iter.GoToBegin();</div><div>iter.GetNeighborhood();</div></blockquote></div><div><br>It seems to work fine for me:<br>
<a href="http://www.vtk.org/Wiki/ITK/Examples/VectorImages/NeighborhoodIterator" target="_blank">http://www.vtk.org/Wiki/ITK/Examples/VectorImages/NeighborhoodIterator</a><br><br>David <br></div></div>
</blockquote></div><br>
</div>
</div>