[ITK-users] Help needed to get the Mean Squared Error and Mutual Information values of two volumes

ibraheem aldhamari ibr_ex at yahoo.com
Thu Jul 14 05:03:08 EDT 2016


Dear users,I am trying to get the values of Mean Squared Error and Mutual Information of two images. The input is two volumes: Imga and Imgb. Both have the same data type, size, spacing and origin. Here is my code :
    typedef itk::MeanSquaresImageToImageMetric < Img_Tuc,Img_Tuc > SDF_T;    typedef itk::MutualInformationImageToImageMetric < Img_Tuc,Img_Tuc> MIF_T;    // Squared Difference       SDF_T::Pointer SD_F = SDF_T::New();
       SD_F->SetFixedImage( Imga->GetOutput(0));       SD_F->SetMovingImage( Imgb->GetOutput(0));       float SD=SD_F->GetValue()  ;
       cout<<"SD Result = " << SD <<endl;   //Mutual Information       MIF_T::Pointer MI_F = MIF_T::New();       MI_F->SetFixedImage (Imga->GetOutput(0));       MI_F->SetMovingImage(Imgb->GetOutput(0));       float MI=MI_F->GetValue() ;       cout<<"MI Result = " << MI <<endl;
 but I keep getting these errors: error: no matching function for call to 'itk::MeanSquaresImageToImageMetric<itk::Image<unsigned char, 3u>, itk::Image<unsigned char, 3u> >::GetValue()'
        float SD=SD_F->GetValue()  ;                               ^
error: no matching function for call to 'itk::MutualInformationImageToImageMetric<itk::Image<unsigned char, 3u>, itk::Image<unsigned char, 3u> >::GetValue()'
        float MI=MI_F->GetValue() ;                                ^
Could you please suggest a correction.Have a nice day!
Ibraheem
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/insight-users/attachments/20160714/32832ff8/attachment.html>


More information about the Insight-users mailing list