[Insight-users] neighborhood iterators on vector images

Rashindra Manniesing rashindra at gmail.com
Fri Apr 22 05:13:25 EDT 2011


Thanks David.

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,

Greetings Rashindra






On Thu, Apr 21, 2011 at 15:02, David Doria <daviddoria at gmail.com> wrote:

> On Thu, Apr 21, 2011 at 8:15 AM, Rashindra Manniesing <rashindra at gmail.com
> > wrote:
>
>>
>> Need some help here!
>>
>> How to properly use the neighborhood iterators on vector images using
>> ZeroFluxNeumannCondition (using ITK 3.20.0) ?
>>
>> 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.
>>
>> Many thanks, Rashindra
>>
>>
>> typedef VectorImage<> VT;
>> typedef ConstNeighborhoodIterator<VT> NT
>>
>> NT::RadiusType radius;
>> radius.Fill();
>>
>> NT iter (rad, img, img->GetLargestPossibleRegion());
>> iter.GoToBegin();
>> iter.GetNeighborhood();
>>
>
> It seems to work fine for me:
> http://www.vtk.org/Wiki/ITK/Examples/VectorImages/NeighborhoodIterator
>
> David
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110422/ee55bf8a/attachment.htm>


More information about the Insight-users mailing list