[Insight-developers] doubts regarding incrementing the operator

Luis Ibanez luis.ibanez at kitware.com
Fri Mar 18 14:22:51 EDT 2011


Hi Aarthy,

The ITK image iterators do not provide the
API for integer arithmetics.

You should call the increment operator twice.

Just like

                           ++it;   ++it;

BTW, if what you are trying to do is to subsample
an image, you may be interested in looking at
the ShrinkImageFilter.


     Regards,


           Luis


---------------------------------------------------
On Fri, Mar 18, 2011 at 2:16 PM, thanga aarthy manoharan
<rthy4u at gmail.com> wrote:
> sir,
>     i have to increment two by two like the iteration starts from one when
> the iterator starts from 1 it has to move to 3 den in a for loop..........
> normal for loop is for (it.GoToBegin(), out.GoToBegin(); !it.IsAtEnd();
> ++it, ++out)
> since i have to increment the input image as 1,3,5,7 i used a for loop like
> shown below
> for (it.GoToBegin(), out.GoToBegin(); !it.IsAtEnd(); it+=2, ++out) but this
> is not working ........ can u help me to find a way to increment the
> operator by 2 .....
>
> Thank You sir ...........
>
>                                                           Yours Truly
>
>
>                                                                   Aarthy
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-developers
>
>


More information about the Insight-developers mailing list