[ITK] Compilation error when changing boundary condition

Bill Lorensen bill.lorensen at gmail.com
Wed Jul 2 12:46:58 EDT 2014


Can you post a complete, compilable example that illustrates the error?


On Wed, Jul 2, 2014 at 12:11 PM, Nicolas Gallego <nicgallego at gmail.com> wrote:
> Hi,
>
> I wrote a program that performs an inner product opperation between a
> neighborhood and a kernel.
>
> typedef itk::ConstNeighborhoodIterator< ImageType >
> NeighborhoodIteratorType;
> typedef itk::ImageKernelOperator< TPixel, Dimension > OperatorType;
>
> But when I change the boundary condition as in example [1] as
>
> typedef itk::ConstantBoundaryCondition< ImageType > BoundaryConditionType;
> typedef itk::ConstNeighborhoodIterator< ImageType, BoundaryConditionType >
> NeighborhoodIteratorType;
> typedef itk::ImageKernelOperator< TPixel, Dimension > OperatorType;
>
> I get the following compilation error ( windows 7, itk 4.5, compiler cl
> Version 16.00.40219.01 for x64, compilation type Debug)
>
> -----------------------------------------------------------------------------------
> erreur : C2664: 'float itk::NeighborhoodInnerProduct<TImage>::operator
> ()(const itk::Neighborhood<TPixel,VDimension> &,const
> itk::Neighborhood<TPixel,VDimension> &) const' : cannot convert parameter 1
> from 'NeighborhoodIteratorType' to 'const
> itk::Neighborhood<TPixel,VDimension> &'
> with
> [
>     TImage=itk::Image<PixelType,3>,
>     TPixel=float,
>     VDimension=3
> ]
> and
> [
>     TPixel=float,
>     VDimension=3
> ]
> Reason: cannot convert from 'NeighborhoodIteratorType' to 'const
> itk::Neighborhood<TPixel,VDimension>'
> with
> [
>     TPixel=float,
>     VDimension=3
> ]
> No user-defined-conversion operator available that can perform this
> conversion, or the operator cannot be called
> ----------------------------------------------------------------------------------------
>
> Refering to the context were the actual inner product is performed
>
> typename NeighborhoodInnerProduct< ImageType > innerProduct;
>
> typedef itk::ImageKernelOperator< TPixel, Dimension > OperatorType;
>
>
> OperatorType imageOperator;
>
>         // image operator configuration
>
> for loop on image iterators
>
> outIt.Set( innerProduct( it, imageOperator) );
>
>
> Any ideas about this issue?
>
> [1] http://www.itk.org/Wiki/ITK/Examples/Iterators/ConstantBoundaryCondition
>
> Nicolás Gallego-Ortiz
> Université catholique de Louvain, Belgium
>
> _______________________________________________
> Community mailing list
> Community at itk.org
> http://public.kitware.com/mailman/listinfo/community
>



-- 
Unpaid intern in BillsBasement at noware dot com



More information about the Community mailing list