[Insight-users] neighborhood iterator

linjiao jiao.lin at gmail.com
Wed Feb 16 12:40:52 EST 2011


Have a question regarding neighborhood iterator. My understanding is that
after creating a neighborhood iterator, one can move the center of a
neighborhood around an image region by increment the iterator:

while (!it.IsAtEnd()) {
 ...
 ++it;
}

Each increment will bring the center to the next pixel in the image region.
I am now wondering if it is possible to define a "grid" in the image region,
and only let the center to move to the next pixel in that grid. 

So for example, we have a 10X10 image, right now we can define a
neighborhood iterator whose center walks like this

(0,0), (1,0), (2,0), .... (9,0), (0,1), (1,1) ....

I am wondering if we can define a neighborhood iterator whose center walks
in 2 steps in x direction, and 3 steps in y direction

(0,0), (2,0), (4,0), ... (8,0), (0,3), (2,3), (4,3), ...

Any hints are very appreciated.

--Jiao
-- 
View this message in context: http://old.nabble.com/neighborhood-iterator-tp30936654p30936654.html
Sent from the ITK - Users mailing list archive at Nabble.com.



More information about the Insight-users mailing list