I want to use a MutualInformationImageToImageMetric type between two images with std::complex&lt;double&gt; at their pixel type:<br><br>typedef std::complex&lt; double &gt; COMPLEXPIXEL;<br>typedef itk::Image&lt; COMPLEXPIXEL , 3&gt;&nbsp; ImageType;&nbsp; <br>typedef itk::MutualInformationImageToImageMetric&lt;ImageType,ImageType&gt; MetricType;<br>MetricType::Pointer metric&nbsp; = MetricType::New();<br><br>VC++6.0/win2K produces compiler errors listed below regarding instantiating the metric pointer.&nbsp; Though, I've seen std::complex&lt;double&gt; being used as a pixel type for itk::Image&lt;,&gt; in other examples.&nbsp; Does anyone know if it is possible to use std::complex&lt;&gt; in the imagetype template for the MutualInformationImageToImageMetric or for any other ITK metric?&nbsp; <br><br>Regards,<br>Rick<br><br><br><br>C:\InsightToolkit-2.2.0\Code\BasicFilters\itkRecursiveSeparableImageFilter.txx(306) : error C2440: 'static_cast' : cannot convert from 'class
 std::complex&lt;double&gt;' to 'float'<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\xstring(583) : while compiling class-template member function 'void __thiscall itk::RecursiveSeparableImageFilter&lt;class itk::Image&lt;class std::complex&lt;double&gt;,3&gt;,class itk::Image&lt;float,3&gt; <br>&gt;::GenerateData(void)'<br>C:\InsightToolkit-2.2.0\Code\BasicFilters\itkGradientRecursiveGaussianImageFilter.txx(226) : error C2784: 'class vnl_vector_fixed&lt;T,n&gt; __cdecl operator /(const class vnl_vector_fixed&lt;T,n&gt; &amp;,T)' : could not deduce template argument for 'const class v<br>nl_vector_fixed&lt;T,n&gt; &amp;' from 'float'<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\xstring(583) : while compiling
 class-template member function 'void __thiscall itk::GradientRecursiveGaussianImageFilter&lt;class itk::Image&lt;class std::complex&lt;double&gt;,3&gt;,class itk::Image&lt;cl<br>ass itk::CovariantVector&lt;class std::complex&lt;double&gt;,3&gt;,3&gt; &gt;::GenerateData(void)'<br>C:\InsightToolkit-2.2.0\Code\BasicFilters\itkGradientRecursiveGaussianImageFilter.txx(226) : error C2784: 'class vnl_matrix_fixed&lt;T,m,n&gt; __cdecl operator /(const class vnl_matrix_fixed&lt;T,m,n&gt; &amp;,T)' : could not deduce template argument for 'const cla<br>ss vnl_matrix_fixed&lt;T,num_rows,num_cols&gt; &amp;' from 'float'<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\xstring(583) : while compiling class-template member function 'void __thiscall itk::GradientRecursiveGaussianImageFilter&lt;class itk::Image&lt;class std::complex&lt;double&gt;,3&gt;,class itk::Image&lt;cl<br>ass itk::CovariantVector&lt;class
 std::complex&lt;double&gt;,3&gt;,3&gt; &gt;::GenerateData(void)'<br>C:\InsightToolkit-2.2.0\Code\BasicFilters\itkGradientRecursiveGaussianImageFilter.txx(226) : error C2782: 'class std::complex&lt;_Ty&gt; __cdecl std::operator /(const _Ty &amp;,const class std::complex&lt;_Ty&gt; &amp;)' : template parameter '_Ty' is ambiguous<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; could be 'double'<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; or&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'float'<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\xstring(583) : while compiling class-template member function 'void __thiscall itk::GradientRecursiveGaussianImageFilter&lt;class itk::Image&lt;class std::complex&lt;double&gt;,3&gt;,class itk::Image&lt;cl<br>ass itk::CovariantVector&lt;class std::complex&lt;double&gt;,3&gt;,3&gt; &gt;::GenerateData(void)'<br>C:\InsightToolkit-2.2.0\Code\BasicFilters\itkGradientRecursiveGaussianImageFilter.txx(226)
 : error C2784: 'class std::complex&lt;_Ty&gt; __cdecl std::operator /(const class std::complex&lt;_Ty&gt; &amp;,const _Ty &amp;)' : could not deduce template argument for 'const <br>class std::complex&lt;_Ty&gt; &amp;' from 'float'<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\xstring(583) : while compiling class-template member function 'void __thiscall itk::GradientRecursiveGaussianImageFilter&lt;class itk::Image&lt;class std::complex&lt;double&gt;,3&gt;,class itk::Image&lt;cl<br>ass itk::CovariantVector&lt;class std::complex&lt;double&gt;,3&gt;,3&gt; &gt;::GenerateData(void)'<br>C:\InsightToolkit-2.2.0\Code\BasicFilters\itkGradientRecursiveGaussianImageFilter.txx(226) : error C2784: 'class std::complex&lt;_Ty&gt; __cdecl std::operator /(const class std::complex&lt;_Ty&gt; &amp;,const class std::complex&lt;_Ty&gt; &amp;)' : could not deduce template <br>argument for 'const class std::complex&lt;_Ty&gt; &amp;' from
 'float'<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\xstring(583) : while compiling class-template member function 'void __thiscall itk::GradientRecursiveGaussianImageFilter&lt;class itk::Image&lt;class std::complex&lt;double&gt;,3&gt;,class itk::Image&lt;cl<br>ass itk::CovariantVector&lt;class std::complex&lt;double&gt;,3&gt;,3&gt; &gt;::GenerateData(void)'<br>C:\InsightToolkit-2.2.0\Code\BasicFilters\itkGradientRecursiveGaussianImageFilter.txx(226) : error C2677: binary '/' : no global operator defined which takes type 'const class std::complex&lt;double&gt;' (or there is no acceptable conversion)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\xstring(583) : while compiling class-template member function 'void __thiscall itk::GradientRecursiveGaussianImageFilter&lt;class itk::Image&lt;class std::complex&lt;double&gt;,3&gt;,class itk::Image&lt;cl<br>ass
 itk::CovariantVector&lt;class std::complex&lt;double&gt;,3&gt;,3&gt; &gt;::GenerateData(void)'<br>C:\InsightToolkit-2.2.0\Code\Common\itkCentralDifferenceImageFunction.txx(78) : error C2679: binary '=' : no operator defined which takes a right-hand operand of type 'const class std::complex&lt;double&gt;' (or there is no acceptable conversion)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\xstring(583) : while compiling class-template member function 'class itk::CovariantVector&lt;double,3&gt; __thiscall itk::CentralDifferenceImageFunction&lt;class itk::Image&lt;class std::complex&lt;doub<br>le&gt;,3&gt;,double&gt;::EvaluateAtIndex(const class itk::Index&lt;3&gt; &amp;) const'<br>C:\InsightToolkit-2.2.0\Code\Common\itkCentralDifferenceImageFunction.txx(81) : error C2784: 'class std::complex&lt;_Ty&gt; &amp;__cdecl std::operator -=(class std::complex&lt;_Ty&gt; &amp;,const class std::complex&lt;_U&gt; &amp;)' : could not
 deduce template argument for 'clas<br>s std::complex&lt;_Ty&gt; &amp;' from 'double'<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\xstring(583) : while compiling class-template member function 'class itk::CovariantVector&lt;double,3&gt; __thiscall itk::CentralDifferenceImageFunction&lt;class itk::Image&lt;class std::complex&lt;doub<br>le&gt;,3&gt;,double&gt;::EvaluateAtIndex(const class itk::Index&lt;3&gt; &amp;) const'<br>C:\InsightToolkit-2.2.0\Code\Common\itkCentralDifferenceImageFunction.txx(81) : error C2677: binary '-=' : no global operator defined which takes type 'const class std::complex&lt;double&gt;' (or there is no acceptable conversion)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\xstring(583) : while compiling class-template member function 'class itk::CovariantVector&lt;double,3&gt; __thiscall itk::CentralDifferenceImageFunction&lt;class
 itk::Image&lt;class std::complex&lt;doub<br>le&gt;,3&gt;,double&gt;::EvaluateAtIndex(const class itk::Index&lt;3&gt; &amp;) const'<br>Error executing cl.exe.<br><p>
                <hr size=1>Blab-away for as little as 1¢/min. Make <a href="http://us.rd.yahoo.com/mail_us/taglines/postman2/*http://us.rd.yahoo.com/evt=39663/*http://voice.yahoo.com"> PC-to-Phone Calls</a> using Yahoo! Messenger with Voice.