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

Dženan Zukić dzenanz at gmail.com
Thu Jul 14 10:47:07 EDT 2016


Hi Ibraheem,

the signature
<https://itk.org/Doxygen/html/classitk_1_1MutualInformationImageToImageMetric.html>
of GetValue method is:
MeasureType GetValue (const ParametersType &parameters) const override;
which means that you need to give transform parameters to get a value. What
you might want is create an identity transform and pass that in.

Regards,
Dženan

On Thu, Jul 14, 2016 at 5:03 AM, ibraheem aldhamari via Insight-users <
insight-users at itk.org> wrote:

> 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
>
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/insight-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20160714/6e560606/attachment-0001.html>
-------------- next part --------------
_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-users


More information about the Community mailing list