<div dir="ltr">Hey ITK Dev,<div><br></div><div style>I'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'm receiving the following error during the compile process just from instantiating the filter with the type std::complex<float></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 'Length' in 'std::complex<double>'</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'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> 'ValueType' in 'std::complex<double>'</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 'const std::complex<double>' to 'OutputPixelValueType' (aka 'double') without a conversion</div><div> operator</div><div> static_cast< OutputPixelValueType >( *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 ('RealType' (aka 'complex<double>') and 'int')</div>
<div> / ( static_cast< RealType >( 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 ('PixelType' (aka 'std::complex<double>') and 'PixelType')</div><div> if ( value > max )</div><div><br></div><div>code:</div><div><div> typedef itk::Image< std::complex<double>, 4> 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->SetRegions(region);</div><div> image->Allocate();</div>
<div> image->FillBuffer(std::complex<double>(1.0,1.0));</div><div><br></div><div> ComplexImageType::Pointer kernel = ComplexImageType::New();</div><div> kernel->SetRegions(kernelRegion);</div>
<div> kernel->Allocate();</div><div> kernel->FillBuffer(std::complex<double>(1.0,1.0));</div><div><br></div><div> typedef itk::ConvolutionImageFilter<ComplexImageType> ConvolutionFilterType;</div>
<div> ConvolutionFilterType::Pointer convolutionFilter = ConvolutionFilterType::New();</div><div> convolutionFilter->SetInput(image);</div><div> convolutionFilter->SetKernelImage(kernel);</div>
<div> convolutionFilter->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>