<div dir="ltr">Hey Matt,<br><div class="gmail_quote"><div dir="ltr"><div><br></div><div>Thanks for the info. I'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"><<a href="mailto:matt.mccormick@kitware.com" target="_blank">matt.mccormick@kitware.com</a>></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'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>
<<a href="mailto:pgwar1@student.monash.edu" target="_blank">pgwar1@student.monash.edu</a>> wrote:<br>
> Hey ITK Dev,<br>
><br>
> I've had no luck on the user list with this question. Does anyone have any<br>
> experience with using ConvolutionImageFilter with complex datasets and<br>
> complex kernels?<br>
><br>
> I'm receiving the following error during the compile process just from<br>
> instantiating the filter with the type std::complex<float><br>
><br>
> ITK/Modules/Core/Common/include/itkPixelTraits.h:49:60: error: no member<br>
> named 'Length' in 'std::complex<double>'<br>
> itkStaticConstMacro(Dimension, unsigned int, TPixelType::Length);<br>
><br>
> I'm also receiving:<br>
><br>
> ITK/Modules/Core/Common/include/itkPixelTraits.h:52:32: error: no type named<br>
> 'ValueType' in 'std::complex<double>'<br>
> typedef typename TPixelType::ValueType ValueType;<br>
><br>
> ITK/Modules/Core/Common/include/itkNeighborhoodInnerProduct.hxx:52:7: error:<br>
> cannot convert 'const std::complex<double>' to 'OutputPixelValueType'<br>
> (aka 'double') without a conversion<br>
> operator<br>
> static_cast< OutputPixelValueType >( *o_it ) *<br>
><br>
> ITK/Modules/Filtering/ImageStatistics/include/itkStatisticsImageFilter.hxx:288:51:<br>
> error:<br>
> invalid operands to binary expression ('RealType' (aka<br>
> 'complex<double>') and 'int')<br>
> / ( static_cast< RealType >( count ) - 1 );<br>
><br>
> ITK/Modules/Filtering/ImageStatistics/include/itkStatisticsImageFilter.hxx:329:16:<br>
> error:<br>
> invalid operands to binary expression ('PixelType' (aka<br>
> 'std::complex<double>') and 'PixelType')<br>
> if ( value > max )<br>
><br>
> code:<br>
> typedef itk::Image< std::complex<double>, 4> ComplexImageType;<br>
><br>
> ComplexImageType::RegionType region;<br>
> region.SetSize(0,15);<br>
> region.SetSize(1,30);<br>
> region.SetSize(2,100);<br>
> region.SetSize(3,100);<br>
><br>
> ComplexImageType::RegionType kernelRegion;<br>
> kernelRegion.SetSize(0,1);<br>
> kernelRegion.SetSize(1,30);<br>
> kernelRegion.SetSize(2,100);<br>
> kernelRegion.SetSize(3,100);<br>
><br>
> ComplexImageType::Pointer image = ComplexImageType::New();<br>
> image->SetRegions(region);<br>
> image->Allocate();<br>
> image->FillBuffer(std::complex<double>(1.0,1.0));<br>
><br>
> ComplexImageType::Pointer kernel = ComplexImageType::New();<br>
> kernel->SetRegions(kernelRegion);<br>
> kernel->Allocate();<br>
> kernel->FillBuffer(std::complex<double>(1.0,1.0));<br>
><br>
> typedef itk::ConvolutionImageFilter<ComplexImageType><br>
> ConvolutionFilterType;<br>
> ConvolutionFilterType::Pointer convolutionFilter =<br>
> ConvolutionFilterType::New();<br>
> convolutionFilter->SetInput(image);<br>
> convolutionFilter->SetKernelImage(kernel);<br>
> convolutionFilter->Update();<br>
><br>
> I have the same errors in 3D, 2D and 1D.<br>
><br>
> Cheers,<br>
> phil<br>
><br>
><br>
><br>
</div></div>> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Kitware offers ITK Training Courses, for more information visit:<br>
> <a href="http://kitware.com/products/protraining.php" target="_blank">http://kitware.com/products/protraining.php</a><br>
><br>
> Please keep messages on-topic and check the ITK FAQ at:<br>
> <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.itk.org/mailman/listinfo/insight-developers" target="_blank">http://www.itk.org/mailman/listinfo/insight-developers</a><br>
><br>
</blockquote></div><br></div>
</div></div></div><br></div>