[Insight-users] ConstNeighborhoodIterator error

David Doria daviddoria+itk at gmail.com
Thu Aug 6 13:07:13 EDT 2009


I am trying to follow Examples/NeighborhoodIterators1.cxx

In the example, there is:
  typedef itk::ConstNeighborhoodIterator< ImageType >
NeighborhoodIteratorType;
...
  NeighborhoodIteratorType::RadiusType radius;
  radius.Fill(1);
  NeighborhoodIteratorType it( radius, reader->GetOutput(),
                               reader->GetOutput()->GetRequestedRegion() );

When I try to do the same thing inside itkConnectedThresholdImageFilter.h
(I'm attempting to modify it):

    typedef itk::ConstNeighborhoodIterator< InputImageType >
NeighborhoodIteratorType;
// I also tried removing the itk:: since I am now working inside itk::
already , with no change in the error
   // typedef ConstNeighborhoodIterator< InputImageType >
NeighborhoodIteratorType;
    NeighborhoodIteratorType::RadiusType radius;

I get
error: dependent-name 'itk::NeighborhoodIteratorType::RadiusType' is parsed
as a non-type, but instantiation yields a type
note: say 'typename itk::NeighborhoodIteratorType::RadiusType' if a type is
meant

I originally tried to create the iterator directly:
ConstNeighborhoodIterator< InputImageType > it(1, this->GetInputImage(),
this->GetInputImage()->GetRequestedRegion() );

but I get a lovely template error:

/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>&)'
/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> >]
/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> >]
/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> >]

Can anyone see what the problem may be?

Thanks,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090806/5d69125a/attachment.htm>


More information about the Insight-users mailing list