<div dir="ltr">Hey ITK Dev,<div><br></div><div style>I&#39;ve had no luck on the user list with this question. Does anyone have any experience with using <span style="font-family:arial,sans-serif;font-size:13px">ConvolutionImageFilter</span> with complex datasets and complex kernels?</div>
<div style><br></div><div style><div style="font-family:arial,sans-serif;font-size:13px">I&#39;m receiving the following error during the compile process just from instantiating the filter with the type std::complex&lt;float&gt;</div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><div>ITK/Modules/Core/Common/include/itkPixelTraits.h:49:60: error: no member</div><div>      named &#39;Length&#39; in &#39;std::complex&lt;double&gt;&#39;</div>
<div>  itkStaticConstMacro(Dimension, unsigned int, TPixelType::Length);</div></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">I&#39;m also receiving:</div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><div>ITK/Modules/Core/Common/include/itkPixelTraits.h:52:32: error: no type named</div><div>      &#39;ValueType&#39; in &#39;std::complex&lt;double&gt;&#39;</div>
<div>  typedef typename TPixelType::ValueType ValueType;</div><div><br></div></div><div style="font-family:arial,sans-serif;font-size:13px"><div>ITK/Modules/Core/Common/include/itkNeighborhoodInnerProduct.hxx:52:7: error: </div>
<div>      cannot convert &#39;const std::complex&lt;double&gt;&#39; to &#39;OutputPixelValueType&#39; (aka &#39;double&#39;) without a conversion</div><div>      operator</div><div>      static_cast&lt; OutputPixelValueType &gt;( *o_it ) *</div>
<div><br></div></div><div style="font-family:arial,sans-serif;font-size:13px"><div>ITK/Modules/Filtering/ImageStatistics/include/itkStatisticsImageFilter.hxx:288:51: error: </div><div>      invalid operands to binary expression (&#39;RealType&#39; (aka &#39;complex&lt;double&gt;&#39;) and &#39;int&#39;)</div>
<div>             / ( static_cast&lt; RealType &gt;( count ) - 1 );</div><div><br></div></div><div style="font-family:arial,sans-serif;font-size:13px"><div>ITK/Modules/Filtering/ImageStatistics/include/itkStatisticsImageFilter.hxx:329:16: error: </div>
<div>      invalid operands to binary expression (&#39;PixelType&#39; (aka &#39;std::complex&lt;double&gt;&#39;) and &#39;PixelType&#39;)</div><div>    if ( value &gt; max )</div><div><br></div><div>code:</div><div><div>          typedef itk::Image&lt; std::complex&lt;double&gt;, 4&gt; ComplexImageType;</div>
<div><br></div><div>          ComplexImageType::RegionType region;</div><div>          region.SetSize(0,15);</div><div>          region.SetSize(1,30);</div><div>          region.SetSize(2,100);</div><div>          region.SetSize(3,100);</div>
<div><br></div><div>          ComplexImageType::RegionType kernelRegion;</div><div>          kernelRegion.SetSize(0,1);</div><div>          kernelRegion.SetSize(1,30);</div><div>          kernelRegion.SetSize(2,100);</div>
<div>          kernelRegion.SetSize(3,100);</div><div><br></div><div>          ComplexImageType::Pointer image = ComplexImageType::New();</div><div>          image-&gt;SetRegions(region);</div><div>          image-&gt;Allocate();</div>
<div>          image-&gt;FillBuffer(std::complex&lt;double&gt;(1.0,1.0));</div><div><br></div><div>          ComplexImageType::Pointer kernel = ComplexImageType::New();</div><div>          kernel-&gt;SetRegions(kernelRegion);</div>
<div>          kernel-&gt;Allocate();</div><div>          kernel-&gt;FillBuffer(std::complex&lt;double&gt;(1.0,1.0));</div><div><br></div><div>          typedef itk::ConvolutionImageFilter&lt;ComplexImageType&gt; ConvolutionFilterType;</div>
<div>          ConvolutionFilterType::Pointer convolutionFilter = ConvolutionFilterType::New();</div><div>          convolutionFilter-&gt;SetInput(image);</div><div>          convolutionFilter-&gt;SetKernelImage(kernel);</div>
<div>          convolutionFilter-&gt;Update();</div></div><div><br></div><div style>I have the same errors in 3D, 2D and 1D.</div><div style><br></div><div style>Cheers,</div><div style>phil</div></div></div><div style><br>
</div><div style><br></div></div>