Thank you, it works. Do you know how to put the input of the filter directly to the filter's output? I don't need any other filters in GenerateData(), only the iterator. I tryed something like that, but I get an error again:<br>
<br>template <class TImageType, class TOutputType><br>void ContourArrayFilter<TImageType, TOutputType>::GenerateData()<br>{<br> //after iterating through input, set input directly to output:<br> this->Update();<br>
this->GraftOutput( this->GetInput() );<br>}<br><br>error C2664: 'itk::ImageSource<TOutputImage>::GraftOutput' : cannot convert parameter 1 from 'const itk::Image<TPixel,VImageDimension> *' to 'itk::DataObject *'<br>
<br><br>Michael<br><br><br><br><br><div class="gmail_quote">2009/10/2 Frederic Perez <span dir="ltr"><<a href="mailto:fredericpcx@gmail.com">fredericpcx@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Michael,<br><br>you might consider using itk::ImageRegionConstIterator instead.<br><br>Cheers,<br><br>Frederic Perez<br><br><div class="gmail_quote"><div><div></div><div class="h5">On Fri, Oct 2, 2009 at 3:05 PM, Michael Xanadu <span dir="ltr"><<a href="mailto:xanadu.michael@googlemail.com" target="_blank">xanadu.michael@googlemail.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5">Hi,<br><br>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:<br>
<br>template <class TImageType, class TOutputType><br>
void ContourArrayFilter<TImageType, TOutputType>::GenerateData()<br>{<br> typedef itk::ImageRegionIterator< TImageType > IteratorType;<br> IteratorType iterator( this->GetInput(), this->GetInput()->GetLargestPossibleRegion());<br>
//...<br>}<br><br>But this->GetInput() delivers a const Pointer while the iterator needs a normal one. So I get:<br><br>cannot convert parameter 1 from 'const itk::Image<TPixel,VImageDimension> *' to 'itk::Image<TPixel,VImageDimension> *'<br>
<br>Does anybody know how to solve the problem? I just wanna iterate the pixels of the input.<br><br><br>Refards, Michael <br><br>
<br></div></div>_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at: <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br>
</blockquote></div><br>