[Insight-users] neighborhood iterator

Jiao Lin jiao.lin at gmail.com
Wed Feb 16 13:18:06 EST 2011


I did take a look at there. But it seems it is for the stride inside
the neighborhood, not for the stride for the center to move around the
image.

--Jiao

On Wed, Feb 16, 2011 at 10:16 AM, David Doria <daviddoria at gmail.com> wrote:
> On Wed, Feb 16, 2011 at 1:11 PM, robert tamburo <robert.tamburo at gmail.com>
> wrote:
>>
>> As you iterate the image, check to see if you're on the grid. If you are,
>> then set and iterate the neighborhood. Something like:
>> while(!it.IsAtEnd())
>>   {
>>   index = it.GetIndex();
>>   if( (index[0] % 2 == 0) && (index[1] % 3 == 0) )  // or whatever
>>     {
>>     neighborhoodIt.SetLocation(index);
>>     // iterateTheNeighborhood
>>     .
>>     .
>>     .
>>     }
>>   ++it;
>>   }
>>
> I think there is a concept of this grid by setting the "Stride" (I think
> this is like a step length per dimension). After a very quick look, I see a
> GetStride function in NeighborhoodIterator (but not a SetStride?) - maybe
> you can do some grepping and see if you come up with anything.
> David


More information about the Insight-users mailing list