<div dir="ltr">Hey ITK,<div><br></div><div>I&#39;m attempting to use the convolution filter, on a complex image, with a complex kernel. Both the kernel and image have 4 dimensions.</div><div><br></div><div style>I feel like I either missed a warning saying complex type is not supported, or I have failed to implement it properly.</div>
<div><br></div><div>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><br></div><div><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><br></div><div style>I&#39;m also receiving:</div><div style>
<br></div><div style><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><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><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><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 style>code:</div><div style><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><br></div><div style>Cheers,</div><div style>Phil</div></div></div></div>