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;<br><br>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() );<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><br>David<br>