[ITK] Compilation error when changing boundary condition

Bill Lorensen bill.lorensen at gmail.com
Wed Jul 2 15:06:46 EDT 2014


I can reproduce your problem and I see the issue.
NeighborhoodInnerProduct operator()'s second argument is const
ConstNeighborhoodIterator< TImage >.
Notice that the boundary condition template parameter is not specified.

So, you cannot change the boundary condition when you use the
neighborhood inner product. This is design bug. I'll take a look at
how this could be redesigned.

Bill

On Wed, Jul 2, 2014 at 1:35 PM, Nicolas Gallego <nicgallego at gmail.com> wrote:
> Hi Bill,
>
> thanks for your interest in this issue,
> here the code that reproduces the problem
>
> Nicolás Gallego-Ortiz
> Université catholique de Louvain, Belgium
>
>
> 2014-07-02 18:46 GMT+02:00 Bill Lorensen <bill.lorensen at gmail.com>:
>
>> 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
>
>



-- 
Unpaid intern in BillsBasement at noware dot com



More information about the Community mailing list