[Insight-users] ConstNeighborhoodIterator error
Karthik Krishnan
karthik.krishnan at kitware.com
Thu Aug 6 13:19:53 EDT 2009
On Thu, Aug 6, 2009 at 1:07 PM, David Doria
<daviddoria+itk at gmail.com<daviddoria%2Bitk at gmail.com>
> wrote:
> 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;
do as the error says. say
typename 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() );
As the error below indicates, the first argument "1" is not castable to a
"SizeType &". Please say:
SizeType size(Dimension);
size.Fill(1); // radius of 1.
ConstNeighborhoodIterator< InputImageType > it(size,
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
>
> _____________________________________
> 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
>
>
--
Karthik Krishnan
R&D Engineer,
Kitware Inc.
Ph: 518 881 4919
Fax: 518 371 4573
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090806/72fc62ef/attachment-0001.htm>
More information about the Insight-users
mailing list