[Insight-users] Q about iterator (how to increase by specific steps)

Erkang Cheng ekyaya at gmail.com
Wed May 23 16:17:33 EDT 2012


Hi everyone:

I want to loop over the image domain by increasing specific steps along
each direction.

Which iterator is appropriated for my case?

I want to realize the following nest loop:

The image size is size_x, size_y, size_z;

And the steps I want to increase are: step_x, step_y, step_z;

for (int z=0; z<size_z; z+=step_z)
    for (int y=0; y<size_y, y+step_y)
            for(int x=0; x<size_x; x+=step_x)
                {
                      // calculate response at (x,y,z)
                }

Is there similar example for me to follow? Thanks.

Best
Erkang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20120523/65405290/attachment.htm>


More information about the Insight-users mailing list