<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Dear All,<div><br></div><div>I have some question about the new implementation of&nbsp;<span style="color: rgb(0, 0, 0); font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); display: inline !important; ">NeighborhoodInnerProduct (ITK 4.1.0 in particular).</span></div><div>In this class the two function operator(...) have &nbsp;define the follows type:</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3">typedef typename TImage::PixelType&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; InputPixelType;</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3">typedef typename NumericTraits&lt; InputPixelType &gt;::RealType&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; InputPixelRealType;</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3">typedef typename NumericTraits&lt; InputPixelRealType &gt;::AccumulateType&nbsp; AccumulateRealType;</font></div></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><br></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3">typedef typename NumericTraits&lt;OutputPixelType&gt;::ValueType&nbsp;&nbsp;OutputPixelValueType;</font></div></div><div><br></div><div>Here I don't understand two things:&nbsp;</div><div>1)&nbsp;Why is define AccumulateRealType from the InputPixelType if the AccumulateType should come from the TOperator class ?</div><div><br></div><div>2) If we use for example the class&nbsp;<span style="font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); display: inline !important; ">NeighborhoodInnerProduct</span>&nbsp; like this&nbsp;itk::NeighborhoodInnerProduct&lt; MovingImageType, ComplexType, ComplexType &gt;, &nbsp;we expect that the type of&nbsp;OutputPixelValueType was complex but instead if float.</div><div><br></div><div>The only way to compile the example&nbsp;(<a href="http://www.insight-journal.org/browse/publication/320">http://www.insight-journal.org/browse/publication/320</a>&nbsp;) was changing:</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3">typedef typename NumericTraits&lt; InputPixelRealType &gt;::AccumulateType&nbsp; AccumulateRealType;</font></div></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3">typedef typename NumericTraits&lt;OutputPixelType&gt;::ValueType&nbsp;&nbsp;OutputPixelValueType;</font></div><div><br></div><div>for</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3">typedef typename NumericTraits&lt; TOperator &gt;::AccumulateType&nbsp; AccumulateRealType;</font></div></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3">typedef typename NumericTraits&lt;OutputPixelType&gt;::RealType OutputPixelValueType;</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><br></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3">Any help will be greatly appreciated. Thank you.</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><br></font></div></div><div><font class="Apple-style-span" color="#15d05a" face="Monaco"></font><div apple-content-edited="true">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-weight: normal; font-style: normal; "><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-weight: normal; font-style: normal; ">Saludos</div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-weight: normal; font-style: normal; ">__________________________________<br><font class="Apple-style-span" color="#b7bfc5">|</font>&nbsp;Ariel Hernán Curiale<br><font class="Apple-style-span" color="#b7bfc5">|</font>&nbsp;ETSI Telecomunicación<br><font class="Apple-style-span" color="#b7bfc5">|</font>&nbsp;Universidad de Valladolid<br><font class="Apple-style-span" color="#b7bfc5">|</font>&nbsp;Campus Miguel Delibes<br><font class="Apple-style-span" color="#b7bfc5">|</font>&nbsp;47011 Valladolid, Spain<br><font class="Apple-style-span" color="#b7bfc5">|</font>&nbsp;Phone: 983-423000 ext. 5590</div><div><font class="Apple-style-span" color="#b7b7b7" style="font-family: Helvetica; font-size: medium; font-weight: normal; font-style: normal; ">|</font>&nbsp;Web:&nbsp;<a href="http://www.curiale.com.ar/"><font class="Apple-style-span" color="#084ebe">www.curiale.com.ar</font></a><br><font class="Apple-style-span" color="#b7b7b7" style="font-family: Helvetica; font-size: medium; font-weight: normal; font-style: normal; ">|</font><span class="Apple-style-span" style="font-family: Helvetica; font-size: medium; font-weight: normal; font-style: normal; color: rgb(0, 0, 0); ">_________________________________</span></div></div></div></div></span></div></span></div></span></div></span></div></div></div></div>
</div>
<br><div><div>El 11/07/2012, a las 17:35, Ariel Hernán Curiale escribió:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Dear All,<div><br></div><div>I'm trying to migrate the code provided into the&nbsp;article&nbsp;"<span style="font-variant: normal; letter-spacing: normal; line-height: 22px; orphans: 2; text-align: center; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); display: inline !important; float: none; ">Image registration using the Morphon algorithm: an ITK implementation</span>" (<a href="http://www.insight-journal.org/browse/publication/320">http://www.insight-journal.org/browse/publication/320</a>&nbsp;) from ITK 3.6 to 4.1 but I have some troubles with the class&nbsp;<span style="color: rgb(0, 0, 0); font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); display: inline !important; float: none; ">NeighborhoodInnerProduct&lt; TImage, TOperator, TComputation &gt;</span></div><div><br></div><div>Where can I find an example using different TOperator and TComputation ?</div><div><br></div><div><br></div><div>For example I'm trying to do this:</div><div><br></div><div>typedef itk::Image &lt; float, Dimension &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MovingImageType;</div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3">typedef std::complex&lt;double&gt;&nbsp;<span class="Apple-tab-span" style="white-space: pre; ">        </span> ComplexType;</font></div></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3">typedef itk::Image&lt; ComplexType, ImageDimension &gt;&nbsp; &nbsp; &nbsp; &nbsp; ComplexMatrixType;</font></div></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3">typedef itk::ConstNeighborhoodIterator&lt; MovingImageType &gt;&nbsp; NeighborhoodIteratorType;</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3">typedef itk::ImageRegionIterator&lt;ComplexMatrixType&gt; ComplexNeighborhoodOperatorType;</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><span class="Apple-style-span" style="font-family: Helvetica; font-size: medium; ">typedef typename FilterType::ComplexOperator &nbsp; ComplexOpType;</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3">&nbsp; &nbsp; &nbsp;&nbsp;</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3">itk::NeighborhoodInnerProduct&lt; MovingImageType, ComplexType, ComplexType &gt; innerProduct;</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; min-height: 15px; "><span class="Apple-style-span" style="font-family: Helvetica; font-size: medium; ">ComplexNeighborhoodOperatorType&nbsp;out;</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; min-height: 15px; "><font class="Apple-style-span" face="Helvetica" size="3">&nbsp;&nbsp; &nbsp; &nbsp;<br class="webkit-block-placeholder"></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3">&nbsp; &nbsp; /* Quadrature Filters */&nbsp; &nbsp; &nbsp;</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3">&nbsp; &nbsp; ComplexOpType* Complexfilter = m_Filters-&gt;GetComplexOp(choice) ;</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3">&nbsp; &nbsp; NeighborhoodIteratorType InIT = NeighborhoodIteratorType( (*Complexfilter).GetRadius() , InImage, InImage-&gt;GetRequestedRegion() );</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; min-height: 15px; "><font class="Apple-style-span" face="Helvetica" size="3">&nbsp; &nbsp; &nbsp;<br class="webkit-block-placeholder"></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3">&nbsp; &nbsp; std::complex&lt;double&gt; temp; &nbsp; &nbsp; &nbsp; &nbsp;</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3">&nbsp; &nbsp; out = ComplexNeighborhoodOperatorType( OutImage, OutImage-&gt;GetRequestedRegion() );</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; min-height: 15px; "><font class="Apple-style-span" face="Helvetica" size="3">&nbsp;&nbsp; &nbsp;<br class="webkit-block-placeholder"></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3">&nbsp; &nbsp; for(InIT.GoToBegin(), out.GoToBegin(); !InIT.IsAtEnd(); ++InIT, ++out )</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3">&nbsp; &nbsp; {</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3">&nbsp; &nbsp; &nbsp; temp = innerProduct ( InIT, (*Complexfilter) ) ;</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3">&nbsp; &nbsp; &nbsp; out.Set( conj(temp) );</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3">&nbsp; &nbsp; }//end for</font></div></div><div><br></div><div><br></div><div><br></div><div><br></div><div>And get the following error:</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; ">InsightToolkit-4.1.0/Modules/Core/Common/include/itkNeighborhoodInnerProduct.hxx:52:7: error: cannot convert 'const std::complex&lt;double&gt;' to 'OutputPixelValueType' (aka 'double') without a conversion operator</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; ">&nbsp; &nbsp; &nbsp; static_cast&lt; OutputPixelValueType &gt;( *o_it ) *</div></div><div><br></div><div><br></div><div>There is something wrong in the code ?&nbsp;</div><div>This code compile perfectly in&nbsp;ITK-3.20.1</div><div><br></div><div><br><div apple-content-edited="true">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div style="color: rgb(0, 0, 0); "><div style="color: rgb(0, 0, 0); ">Any help will be greatly appreciated. Thank you</div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-weight: normal; font-style: normal; ">__________________________________<br><font class="Apple-style-span" color="#b7bfc5">|</font>&nbsp;Ariel Hernán Curiale<br><font class="Apple-style-span" color="#b7bfc5">|</font>&nbsp;ETSI Telecomunicación<br><font class="Apple-style-span" color="#b7bfc5">|</font>&nbsp;Universidad de Valladolid<br><font class="Apple-style-span" color="#b7bfc5">|</font>&nbsp;Campus Miguel Delibes<br><font class="Apple-style-span" color="#b7bfc5">|</font>&nbsp;47011 Valladolid, Spain<br><font class="Apple-style-span" color="#b7bfc5">|</font>&nbsp;Phone: 983-423000 ext. 5590</div><div style="font-family: Helvetica; font-size: medium; font-weight: normal; font-style: normal; "><font class="Apple-style-span" color="#b7b7b7" style="font-family: Helvetica; font-size: medium; font-weight: normal; font-style: normal; ">|</font>&nbsp;Web:&nbsp;<a href="http://www.curiale.com.ar/"><font class="Apple-style-span" color="#084ebe">www.curiale.com.ar</font></a><br><font class="Apple-style-span" color="#b7b7b7" style="font-family: Helvetica; font-size: medium; font-weight: normal; font-style: normal; ">|</font>_________________________________</div></div></div></div></div></div></div></div></div></div></div>
</div>
<br></div></div></blockquote></div><br></div></body></html>