[Insight-developers] Smart Pointer (continue)

Yinpeng Jin yj76@columbia.edu
Thu, 25 Apr 2002 11:54:20 -0400


yes, this works, and I think it is the better way.
thanks, Luis.
Yinpeng.

----- Original Message -----
From: "Luis Ibanez" <luis.ibanez@kitware.com>
To: "Yinpeng Jin" <yj76@columbia.edu>
Cc: <Insight-developers@public.kitware.com>
Sent: Thursday, April 25, 2002 11:49 AM
Subject: Re: [Insight-developers] Smart Pointer (continue)


>
> Yinpeng,
>
>
> You have to replace the current iterator
> with a const iterator.
>
> Replace:
>
>     ImageRegionIteratorWithIndex
>
> with:
>
>      ImageRegionConstIteratorWithIndex
>
>
> For that, you will also have to add a:
>
> #include "itkImageRegionConstIteratorWithIndex.h"
>
>
> The constructors of const iterators accept :
>
>         "const Image *"
>
> as argument.
>
>
>
>
> Luis
>
> ==================================
>
> Yinpeng Jin wrote:
> > Luis:
> > that was my first thought, too, I tried
> > const InputImageType*
> > and InputImageConstPointer input
> > both give me similar error.
> >
> > I think the reason is that
> > this->GetInput() returns a InputImageConstPointer (from
ImageToImageFilter)
> > but the iterator need a "TImage *" as the first par.
> > maybe something needs to change in ImageToImageFilter or
> > ImageRegionIteratorWithIndex
> > I am not sure if my understanding is correct.
> > But if we don't want to change ImageToImageFilter or
> > ImageRegionIteratorWithIndex,
> > is there anything I can do? static cast?
> > yinpeng.
> >
> >
> > ----- Original Message -----
>
>
> _______________________________________________
> Insight-developers mailing list
> Insight-developers@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-developers
>