<div class="gmail_quote">On Thu, Aug 6, 2009 at 1:07 PM, David Doria <span dir="ltr"><<a href="mailto:daviddoria%2Bitk@gmail.com">daviddoria+itk@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I am trying to follow Examples/NeighborhoodIterators1.cxx<br><br>In the example, there is:<br> typedef itk::ConstNeighborhoodIterator< ImageType > NeighborhoodIteratorType;<br>...<br> NeighborhoodIteratorType::RadiusType radius;<br>
radius.Fill(1);<br> NeighborhoodIteratorType it( radius, reader->GetOutput(),<br>
reader->GetOutput()->GetRequestedRegion() );<br><br>When I try to do the same thing inside itkConnectedThresholdImageFilter.h (I'm attempting to modify it):<br><br> typedef itk::ConstNeighborhoodIterator< InputImageType > NeighborhoodIteratorType;<br>
// I also tried removing the itk:: since I am now working inside itk:: already , with no change in the error<br> // typedef ConstNeighborhoodIterator< InputImageType > NeighborhoodIteratorType;<br>
NeighborhoodIteratorType::RadiusType radius;</blockquote><div><br>do as the error says. say<br><br> typename NeighborhoodIteratorType::RadiusType radius;<br><br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I get<br>error: dependent-name 'itk::NeighborhoodIteratorType::RadiusType' is parsed as a non-type, but instantiation yields a type<br>note: say 'typename itk::NeighborhoodIteratorType::RadiusType' if a type is meant<br>
<br>I originally tried to create the iterator directly:<br>ConstNeighborhoodIterator< InputImageType > it(1, this->GetInputImage(), this->GetInputImage()->GetRequestedRegion() );</blockquote><div><br>As the error below indicates, the first argument "1" is not castable to a "SizeType &". Please say:<br>
<br> SizeType size(Dimension);<br> size.Fill(1); // radius of 1.<br> ConstNeighborhoodIterator< InputImageType > it(size, this->GetInputImage(),this->GetInputImage()->GetRequestedRegion() );<br><br><br><br>
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br><br>but I get a lovely template error:<br>
<br>/home/doriad/src/Insight/Code/Common/itkRegionEdgeFunction.h:128: error: no matching function for call to 'itk::ConstNeighborhoodIterator<itk::Image<float, 1u>, itk::ZeroFluxNeumannBoundaryCondition<itk::Image<float, 1u> > >::ConstNeighborhoodIterator(int, const itk::Image<float, 1u>*, const itk::ImageRegion<1u>&)'<br>
/home/doriad/src/Insight/Code/Common/itkConstNeighborhoodIterator.h:111: note: candidates are: itk::ConstNeighborhoodIterator<TImage, TBoundaryCondition>::ConstNeighborhoodIterator(const typename itk::Neighborhood<typename TImage::InternalPixelType*, itk::ConstNeighborhoodIterator<TImage, TBoundaryCondition>::Dimension, itk::NeighborhoodAllocator<typename TImageType::InternalPixelType*> >::SizeType&, const TImage*, const typename TImage::RegionType&) [with TImage = itk::Image<float, 1u>, TBoundaryCondition = itk::ZeroFluxNeumannBoundaryCondition<itk::Image<float, 1u> >]<br>
/home/doriad/src/Insight/Code/Common/itkConstNeighborhoodIterator.txx:186: note: itk::ConstNeighborhoodIterator<TImage, TBoundaryCondition>::ConstNeighborhoodIterator(const itk::ConstNeighborhoodIterator<TImage, TBoundaryCondition>&) [with TImage = itk::Image<float, 1u>, TBoundaryCondition = itk::ZeroFluxNeumannBoundaryCondition<itk::Image<float, 1u> >]<br>
/home/doriad/src/Insight/Code/Common/itkConstNeighborhoodIterator.txx:158: note: itk::ConstNeighborhoodIterator<TImage, TBoundaryCondition>::ConstNeighborhoodIterator() [with TImage = itk::Image<float, 1u>, TBoundaryCondition = itk::ZeroFluxNeumannBoundaryCondition<itk::Image<float, 1u> >]<br>
<br>Can anyone see what the problem may be?<br><br clear="all">Thanks,<br><font color="#888888"><br>David<br>
</font><br>_____________________________________<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><br clear="all"><br>-- <br>Karthik Krishnan<br>R&D Engineer,<br>Kitware Inc.<br>Ph: 518 881 4919<br>Fax: 518 371 4573<br>