<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Hi Ibraheem,</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">the <a href="https://itk.org/Doxygen/html/classitk_1_1MutualInformationImageToImageMetric.html">signature</a> of GetValue method is:</div><div class="gmail_default"><font face="monospace, monospace">MeasureType GetValue (const ParametersType &parameters) const override;</font><br></div><div class="gmail_default"><font face="verdana, sans-serif">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.</font></div><div class="gmail_default"><font face="verdana, sans-serif"><br></font></div><div class="gmail_default"><font face="verdana, sans-serif">Regards,</font></div><div class="gmail_default"><font face="verdana, sans-serif">Dženan</font></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 14, 2016 at 5:03 AM, ibraheem aldhamari via Insight-users <span dir="ltr"><<a href="mailto:insight-users@itk.org" target="_blank">insight-users@itk.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="color:#000;background-color:#fff;font-family:HelveticaNeue-Light,Helvetica Neue Light,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:16px"><div>Dear users,</div><div dir="ltr">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 :</div><div dir="ltr"><br></div><pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">    </span><span style="color:#808000">typedef</span><span style="color:#c0c0c0"> </span><span style="color:#800080">itk</span><span style="color:#000000">::</span><span style="color:#800080">MeanSquaresImageToImageMetric</span><span style="color:#c0c0c0"> </span><span style="color:#000000"><</span><span style="color:#c0c0c0"> </span><span style="color:#800080">Img_Tuc</span><span style="color:#000000">,</span><span style="color:#800080">Img_Tuc</span><span style="color:#c0c0c0"> </span><span style="color:#000000">></span><span style="color:#c0c0c0"> </span><span style="color:#800080">SDF_T</span><span style="color:#000000">;</span></pre><div dir="ltr">

</div><pre style="margin-top:0px;margin-bottom:0px"><span style="color:#c0c0c0">    </span><span style="color:#808000">typedef</span><span style="color:#c0c0c0"> </span><span style="color:#800080">itk</span>::<span style="color:#800080">MutualInformationImageToImageMetric</span><span style="color:#c0c0c0"> </span><<span style="color:#c0c0c0"> </span><span style="color:#800080">Img_Tuc</span>,<span style="color:#800080">Img_Tuc</span>><span style="color:#c0c0c0"> </span><span style="color:#800080">MIF_T</span>;</pre><pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">    </span><font color="#008000">//</font><span style="color:#c0c0c0"> </span><span style="color:#008000">Squared</span><span style="color:#c0c0c0"> </span><span style="color:#008000">Difference</span></pre><pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:rgb(192,192,192)">       </span><span>SDF_T::Pointer</span><span> </span><span>SD_F</span><span> </span><span>=</span><span> </span><span>SDF_T::New();</span><br></pre><pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span>       </span><span>SD_F->SetFixedImage(</span><span> </span><span>Imga->GetOutput(0));</span></pre><pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span>       </span><span>SD_F->SetMovingImage(</span><span> </span><span>Imgb->GetOutput(0));</span></pre><pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span>       </span><span>float</span><span> </span><span>SD=SD_F->GetValue()</span><span>  </span><span>;</span><br></pre><pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span>       </span>cout<span><<</span><span>"SD</span><span> </span><span>Result</span><span> </span><span>=</span><span> </span><span>"</span><span> </span><span><<</span><span> </span>SD<span> </span><span><<</span>endl<span>;</span></pre><pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">   </span><span style="color:#008000">//Mutual</span><span style="color:#c0c0c0"> </span><span style="color:#008000">Information</span></pre><pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="color:#c0c0c0">    </span><span style="color:#c0c0c0">   </span><span>MIF_T::Pointer</span><span> </span><span>MI_F</span><span> </span><span>=</span><span> </span><span>MIF_T::New();</span></pre><pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span>     </span><span>  </span><span>MI_F->SetFixedImage</span><span> </span><span>(Imga->GetOutput(0));</span></pre><pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span>     </span><span>  </span><span>MI_F->SetMovingImage(Imgb->GetOutput(0));</span></pre><pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span>       </span><span>float</span><span> </span><span>MI=MI_F->GetValue()</span><span> </span><span>;</span></pre><div dir="ltr">












</div><pre style="margin-top:0px;margin-bottom:0px"><span>       </span><span>cout<<"MI</span><span> </span><span>Result</span><span> </span><span>=</span><span> </span><span>"</span><span> </span><span><<</span><span> </span><span>MI</span><span> </span><span><<endl;</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:HelveticaNeue-Light,'Helvetica Neue Light','Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif"> </span><span style="font-family:HelveticaNeue-Light,'Helvetica Neue Light','Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif">but I keep getting these errors:</span></pre><pre style="margin-top:0px;margin-bottom:0px"> error: no matching function for call to 'itk::MeanSquaresImageToImageMetric<itk::Image<unsigned char, 3u>, itk::Image<unsigned char, 3u> >::GetValue()'<br></pre><pre style="margin-top:0px;margin-bottom:0px"><span>        float SD=SD_F->GetValue()  ;                               ^<br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><span>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() ;                                ^
</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:HelveticaNeue-Light,'Helvetica Neue Light','Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif">Could you please suggest a correction.</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:HelveticaNeue-Light,'Helvetica Neue Light','Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif">Have a nice day!</span><span class="HOEnZb"><font color="#888888"><br></font></span></pre><span class="HOEnZb"><font color="#888888"><pre style="margin-top:0px;margin-bottom:0px"><font face="HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif">Ibraheem</font></pre></font></span></div></div><br>_____________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.php" rel="noreferrer" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" rel="noreferrer" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/insight-users" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br></div>