<div dir="ltr">Hey ITK,<div><br></div><div>I'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'm receiving the following error during the compile process just from instantiating the filter with the type std::complex<float></div><div><br></div><div><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><br></div><div style>I'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> 'ValueType' in 'std::complex<double>'</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 '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><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><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 style>code:</div><div style><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><br></div><div style>Cheers,</div><div style>Phil</div></div></div></div>