<div dir="ltr">Hey Matt,<br><div class="gmail_quote"><div dir="ltr"><div><br></div><div>Thanks for the info. I&#39;ll have a look at the fixes.</div><div><br></div><div>I have attempted multiplying FFTs also and found issues with the FFT filter which I am currently working through.</div>

<div><br></div><div>Cheers,</div><div>Phil</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On 7 May 2013 03:36, Matt McCormick <span dir="ltr">&lt;<a href="mailto:matt.mccormick@kitware.com" target="_blank">matt.mccormick@kitware.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Phil,<br>
<br>
I have not tried, but in Git master there were recently fixes to<br>
NumericTraits for std::complex.<br>
<br>
Secondly, you may want to try multiplying FFT&#39;s instead.<br>
<br>
HTH,<br>
Matt<br>
<div><div><br>
On Sun, Apr 28, 2013 at 11:23 PM, Phillip George Dayan Ward<br>
&lt;<a href="mailto:pgwar1@student.monash.edu" target="_blank">pgwar1@student.monash.edu</a>&gt; wrote:<br>
&gt; Hey ITK Dev,<br>
&gt;<br>
&gt; I&#39;ve had no luck on the user list with this question. Does anyone have any<br>
&gt; experience with using ConvolutionImageFilter with complex datasets and<br>
&gt; complex kernels?<br>
&gt;<br>
&gt; I&#39;m receiving the following error during the compile process just from<br>
&gt; instantiating the filter with the type std::complex&lt;float&gt;<br>
&gt;<br>
&gt; ITK/Modules/Core/Common/include/itkPixelTraits.h:49:60: error: no member<br>
&gt;       named &#39;Length&#39; in &#39;std::complex&lt;double&gt;&#39;<br>
&gt;   itkStaticConstMacro(Dimension, unsigned int, TPixelType::Length);<br>
&gt;<br>
&gt; I&#39;m also receiving:<br>
&gt;<br>
&gt; ITK/Modules/Core/Common/include/itkPixelTraits.h:52:32: error: no type named<br>
&gt;       &#39;ValueType&#39; in &#39;std::complex&lt;double&gt;&#39;<br>
&gt;   typedef typename TPixelType::ValueType ValueType;<br>
&gt;<br>
&gt; ITK/Modules/Core/Common/include/itkNeighborhoodInnerProduct.hxx:52:7: error:<br>
&gt;       cannot convert &#39;const std::complex&lt;double&gt;&#39; to &#39;OutputPixelValueType&#39;<br>
&gt; (aka &#39;double&#39;) without a conversion<br>
&gt;       operator<br>
&gt;       static_cast&lt; OutputPixelValueType &gt;( *o_it ) *<br>
&gt;<br>
&gt; ITK/Modules/Filtering/ImageStatistics/include/itkStatisticsImageFilter.hxx:288:51:<br>
&gt; error:<br>
&gt;       invalid operands to binary expression (&#39;RealType&#39; (aka<br>
&gt; &#39;complex&lt;double&gt;&#39;) and &#39;int&#39;)<br>
&gt;              / ( static_cast&lt; RealType &gt;( count ) - 1 );<br>
&gt;<br>
&gt; ITK/Modules/Filtering/ImageStatistics/include/itkStatisticsImageFilter.hxx:329:16:<br>
&gt; error:<br>
&gt;       invalid operands to binary expression (&#39;PixelType&#39; (aka<br>
&gt; &#39;std::complex&lt;double&gt;&#39;) and &#39;PixelType&#39;)<br>
&gt;     if ( value &gt; max )<br>
&gt;<br>
&gt; code:<br>
&gt;           typedef itk::Image&lt; std::complex&lt;double&gt;, 4&gt; ComplexImageType;<br>
&gt;<br>
&gt;           ComplexImageType::RegionType region;<br>
&gt;           region.SetSize(0,15);<br>
&gt;           region.SetSize(1,30);<br>
&gt;           region.SetSize(2,100);<br>
&gt;           region.SetSize(3,100);<br>
&gt;<br>
&gt;           ComplexImageType::RegionType kernelRegion;<br>
&gt;           kernelRegion.SetSize(0,1);<br>
&gt;           kernelRegion.SetSize(1,30);<br>
&gt;           kernelRegion.SetSize(2,100);<br>
&gt;           kernelRegion.SetSize(3,100);<br>
&gt;<br>
&gt;           ComplexImageType::Pointer image = ComplexImageType::New();<br>
&gt;           image-&gt;SetRegions(region);<br>
&gt;           image-&gt;Allocate();<br>
&gt;           image-&gt;FillBuffer(std::complex&lt;double&gt;(1.0,1.0));<br>
&gt;<br>
&gt;           ComplexImageType::Pointer kernel = ComplexImageType::New();<br>
&gt;           kernel-&gt;SetRegions(kernelRegion);<br>
&gt;           kernel-&gt;Allocate();<br>
&gt;           kernel-&gt;FillBuffer(std::complex&lt;double&gt;(1.0,1.0));<br>
&gt;<br>
&gt;           typedef itk::ConvolutionImageFilter&lt;ComplexImageType&gt;<br>
&gt; ConvolutionFilterType;<br>
&gt;           ConvolutionFilterType::Pointer convolutionFilter =<br>
&gt; ConvolutionFilterType::New();<br>
&gt;           convolutionFilter-&gt;SetInput(image);<br>
&gt;           convolutionFilter-&gt;SetKernelImage(kernel);<br>
&gt;           convolutionFilter-&gt;Update();<br>
&gt;<br>
&gt; I have the same errors in 3D, 2D and 1D.<br>
&gt;<br>
&gt; Cheers,<br>
&gt; phil<br>
&gt;<br>
&gt;<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Kitware offers ITK Training Courses, for more information visit:<br>
&gt; <a href="http://kitware.com/products/protraining.php" target="_blank">http://kitware.com/products/protraining.php</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the ITK FAQ at:<br>
&gt; <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.itk.org/mailman/listinfo/insight-developers" target="_blank">http://www.itk.org/mailman/listinfo/insight-developers</a><br>
&gt;<br>
</blockquote></div><br></div>
</div></div></div><br></div>