<div dir="ltr"><div>Hi,<br><br></div><div>I wrote a program that performs an inner product opperation between a neighborhood and a kernel.<br><br><span style="color:rgb(128,128,0)">typedef</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">itk</span><span style="color:rgb(0,0,0)">::</span><span style="color:rgb(128,0,128)">ConstNeighborhoodIterator</span><span style="color:rgb(0,0,0)"><</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">ImageType</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">></span><span style="color:rgb(192,192,192)">     </span><span style="color:rgb(128,0,128)">NeighborhoodIteratorType;</span><br>
<span style="color:rgb(128,0,128)"><span style="color:rgb(128,128,0)">typedef</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">itk</span><span style="color:rgb(0,0,0)">::</span><span style="color:rgb(128,0,128)">ImageKernelOperator</span><span style="color:rgb(0,0,0)"><</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">TPixel</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span>Dimension<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">></span><span style="color:rgb(192,192,192)">  </span><span style="color:rgb(128,0,128)">OperatorType</span><span style="color:rgb(0,0,0)">;<br>
<br></span></span>But when I change the boundary condition as in example [1] as<br><br></div><div><span style="color:rgb(128,128,0)">typedef</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">itk</span><span style="color:rgb(0,0,0)">::</span><span style="color:rgb(128,0,128)">ConstantBoundaryCondition</span><span style="color:rgb(0,0,0)"><</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">ImageType</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">></span><span style="color:rgb(192,192,192)">  </span><span style="color:rgb(128,0,128)">BoundaryConditionType</span><span style="color:rgb(0,0,0)">;</span><span style="color:rgb(192,192,192)">    <br>
</span><span style="color:rgb(128,128,0)">typedef</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">itk</span><span style="color:rgb(0,0,0)">::</span><span style="color:rgb(128,0,128)">ConstNeighborhoodIterator</span><span style="color:rgb(0,0,0)"><</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">ImageType</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">BoundaryConditionType</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">></span><span style="color:rgb(192,192,192)">     </span><span style="color:rgb(128,0,128)">NeighborhoodIteratorType</span><span style="color:rgb(0,0,0)">;<br>
</span><span style="color:rgb(128,0,128)"><span style="color:rgb(128,128,0)">typedef</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">itk</span><span style="color:rgb(0,0,0)">::</span><span style="color:rgb(128,0,128)">ImageKernelOperator</span><span style="color:rgb(0,0,0)"><</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">TPixel</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span>Dimension<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">></span><span style="color:rgb(192,192,192)">  </span><span style="color:rgb(128,0,128)">OperatorType</span><span style="color:rgb(0,0,0)">;</span></span><br>
<span style="color:rgb(0,0,0)"></span></div><div><br></div><div>I get the following compilation error ( windows 7, itk 4.5, compiler cl  Version 16.00.40219.01 for x64, compilation type Debug)<br><br>-----------------------------------------------------------------------------------<br>
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> &'<br>
with<br>[<br>    TImage=itk::Image<PixelType,3>,<br>    TPixel=float,<br>    VDimension=3<br>]<br>and<br>[<br>    TPixel=float,<br>    VDimension=3<br>]<br>Reason: cannot convert from 'NeighborhoodIteratorType' to 'const itk::Neighborhood<TPixel,VDimension>'<br>
with<br>[<br>    TPixel=float,<br>    VDimension=3<br>]<br>No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called<br></div>----------------------------------------------------------------------------------------<br>
<br>Refering to the context were the actual inner product is performed<br><br><span style="color:rgb(128,128,0)">typename</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">NeighborhoodInnerProduct</span><span style="color:rgb(0,0,0)"><</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">ImageType</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">></span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">innerProduct</span><span style="color:rgb(0,0,0)">;<br>
</span><br><span style="color:rgb(0,0,0)"><span style="color:rgb(128,128,0)">typedef</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">itk</span><span style="color:rgb(0,0,0)">::</span><span style="color:rgb(128,0,128)">ImageKernelOperator</span><span style="color:rgb(0,0,0)"><</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">TPixel</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span>Dimension<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">></span><span style="color:rgb(192,192,192)">  </span><span style="color:rgb(128,0,128)">OperatorType</span><span style="color:rgb(0,0,0)">;<br>
<br></span></span><br><span style="color:rgb(0,0,0)"><span style="color:rgb(0,0,0)"><span style="color:rgb(128,0,128)">OperatorType</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">imageOperator</span><span style="color:rgb(0,0,0)">;</span>
</span></span><pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)">        // image operator configuration</span><br></pre><span style="color:rgb(0,0,0)"><span style="color:rgb(0,0,0)"></span></span><span style="color:rgb(128,128,0)">for</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">loop on image iterators<br>
</span><br><span style="color:rgb(0,0,0)">outIt</span><span style="color:rgb(0,0,0)">.</span>Set<span style="color:rgb(0,0,0)">(</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">innerProduct</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">it</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">imageOperator</span><span style="color:rgb(0,0,0)">)</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">);<br>
</span><span style="color:rgb(192,192,192)"></span><span style="color:rgb(192,192,192)">        </span><br><span style="color:rgb(0,0,0)"></span><pre style="margin-top:0px;margin-right:0px;margin-bottom:0px;text-indent:0px">
<br></pre>Any ideas about this issue?<br><br>[1] <a href="http://www.itk.org/Wiki/ITK/Examples/Iterators/ConstantBoundaryCondition">http://www.itk.org/Wiki/ITK/Examples/Iterators/ConstantBoundaryCondition</a> <br><br clear="all">
<div><div dir="ltr">Nicolás Gallego-Ortiz<br>Université catholique de Louvain, Belgium<br></div></div>
</div>