[Insight-users] ImageRegionIterator inside ImageToImageFilter

Frederic Perez fredericpcx at gmail.com
Fri Oct 2 09:19:42 EDT 2009


Hi Michael,

you might consider using itk::ImageRegionConstIterator instead.

Cheers,

Frederic Perez

On Fri, Oct 2, 2009 at 3:05 PM, Michael Xanadu <
xanadu.michael at googlemail.com> wrote:

> Hi,
>
> i wanna write my own filter dereived from ImageToImageFilter. In
> GenerateData() i want to use an ImageRegionIterator, which shall get the
> Input of the filter:
>
> template <class TImageType, class TOutputType>
> void ContourArrayFilter<TImageType, TOutputType>::GenerateData()
> {
>     typedef itk::ImageRegionIterator< TImageType > IteratorType;
>     IteratorType iterator( this->GetInput(),
> this->GetInput()->GetLargestPossibleRegion());
>     //...
> }
>
> But this->GetInput() delivers a const Pointer while the iterator needs a
> normal one. So I get:
>
> cannot convert parameter 1 from 'const itk::Image<TPixel,VImageDimension>
> *' to 'itk::Image<TPixel,VImageDimension> *'
>
> Does anybody know how to solve the problem? I just wanna iterate the pixels
> of the input.
>
>
> Refards, Michael
>
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.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-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20091002/ba3d7188/attachment.htm>


More information about the Insight-users mailing list