<html><head></head><body><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 id="yui_3_16_0_1_1468481327197_9839">Dear users,</div><div id="yui_3_16_0_1_1468481327197_9839" 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 id="yui_3_16_0_1_1468481327197_9839" dir="ltr"><br></div><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;" id="yui_3_16_0_1_1468481327197_10563"><!--StartFragment--><span style=" color:#c0c0c0;" id="yui_3_16_0_1_1468481327197_10564"> </span><span style=" color:#808000;" id="yui_3_16_0_1_1468481327197_10565">typedef</span><span style=" color:#c0c0c0;" id="yui_3_16_0_1_1468481327197_10566"> </span><span style=" color:#800080;" id="yui_3_16_0_1_1468481327197_10567">itk</span><span style=" color:#000000;" id="yui_3_16_0_1_1468481327197_10568">::</span><span style=" color:#800080;" id="yui_3_16_0_1_1468481327197_10569">MeanSquaresImageToImageMetric</span><span style=" color:#c0c0c0;" id="yui_3_16_0_1_1468481327197_10570"> </span><span style=" color:#000000;" id="yui_3_16_0_1_1468481327197_10571"><</span><span style=" color:#c0c0c0;" id="yui_3_16_0_1_1468481327197_10572"> </span><span style=" color:#800080;" id="yui_3_16_0_1_1468481327197_10573">Img_Tuc</span><span style=" color:#000000;" id="yui_3_16_0_1_1468481327197_10574">,</span><span style=" color:#800080;" id="yui_3_16_0_1_1468481327197_10575">Img_Tuc</span><span style=" color:#c0c0c0;" id="yui_3_16_0_1_1468481327197_10576"> </span><span style=" color:#000000;" id="yui_3_16_0_1_1468481327197_10577">></span><span style=" color:#c0c0c0;" id="yui_3_16_0_1_1468481327197_10578"> </span><span style=" color:#800080;" id="yui_3_16_0_1_1468481327197_10579">SDF_T</span><span style=" color:#000000;" id="yui_3_16_0_1_1468481327197_10580">;</span></pre><div id="yui_3_16_0_1_1468481327197_9839" dir="ltr">
</div><pre style="margin-top: 0px; margin-bottom: 0px;" id="yui_3_16_0_1_1468481327197_10581"><span style=" color:#c0c0c0;" id="yui_3_16_0_1_1468481327197_10582"> </span><span style=" color:#808000;" id="yui_3_16_0_1_1468481327197_10583">typedef</span><span style=" color:#c0c0c0;" id="yui_3_16_0_1_1468481327197_10584"> </span><span style=" color:#800080;" id="yui_3_16_0_1_1468481327197_10585">itk</span>::<span style=" color:#800080;" id="yui_3_16_0_1_1468481327197_10586">MutualInformationImageToImageMetric</span><span style=" color:#c0c0c0;" id="yui_3_16_0_1_1468481327197_10587"> </span><<span style=" color:#c0c0c0;" id="yui_3_16_0_1_1468481327197_10588"> </span><span style=" color:#800080;" id="yui_3_16_0_1_1468481327197_10589">Img_Tuc</span>,<span style=" color:#800080;" id="yui_3_16_0_1_1468481327197_10590">Img_Tuc</span>><span style=" color:#c0c0c0;" id="yui_3_16_0_1_1468481327197_10591"> </span><span style=" color:#800080;" id="yui_3_16_0_1_1468481327197_10592">MIF_T</span>;<!--EndFragment--></pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;" id="yui_3_16_0_1_1468481327197_10179"><!--StartFragment--><span style=" color:#c0c0c0;" id="yui_3_16_0_1_1468481327197_10180"> </span><font color="#008000">//</font><span style=" color:#c0c0c0;" id="yui_3_16_0_1_1468481327197_10182"> </span><span style=" color:#008000;" id="yui_3_16_0_1_1468481327197_10183">Squared</span><span style=" color:#c0c0c0;" id="yui_3_16_0_1_1468481327197_10184"> </span><span style=" color:#008000;" id="yui_3_16_0_1_1468481327197_10185">Difference</span></pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;" id="yui_3_16_0_1_1468481327197_10179"><span id="yui_3_16_0_1_1468481327197_10187" style="color: rgb(192, 192, 192);"> </span><span id="yui_3_16_0_1_1468481327197_10188">SDF_T::Pointer</span><span id="yui_3_16_0_1_1468481327197_10189"> </span><span id="yui_3_16_0_1_1468481327197_10190">SD_F</span><span id="yui_3_16_0_1_1468481327197_10191"> </span><span id="yui_3_16_0_1_1468481327197_10192">=</span><span id="yui_3_16_0_1_1468481327197_10193"> </span><span id="yui_3_16_0_1_1468481327197_10194">SDF_T::New();</span><br></pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;" id="yui_3_16_0_1_1468481327197_10195"><span id="yui_3_16_0_1_1468481327197_10196"> </span><span id="yui_3_16_0_1_1468481327197_10197">SD_F->SetFixedImage(</span><span id="yui_3_16_0_1_1468481327197_10198"> </span><span id="yui_3_16_0_1_1468481327197_10199">Imga->GetOutput(0));</span></pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;" id="yui_3_16_0_1_1468481327197_10200"><span id="yui_3_16_0_1_1468481327197_10201"> </span><span id="yui_3_16_0_1_1468481327197_10202">SD_F->SetMovingImage(</span><span id="yui_3_16_0_1_1468481327197_10203"> </span><span id="yui_3_16_0_1_1468481327197_10204">Imgb->GetOutput(0));</span></pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;" id="yui_3_16_0_1_1468481327197_10205"><span id="yui_3_16_0_1_1468481327197_10209"> </span><span id="yui_3_16_0_1_1468481327197_10210">float</span><span id="yui_3_16_0_1_1468481327197_10211"> </span><span id="yui_3_16_0_1_1468481327197_10212">SD=SD_F->GetValue()</span><span id="yui_3_16_0_1_1468481327197_10213"> </span><span id="yui_3_16_0_1_1468481327197_10214">;</span><br></pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;" id="yui_3_16_0_1_1468481327197_10215"><span id="yui_3_16_0_1_1468481327197_10216"> </span>cout<span id="yui_3_16_0_1_1468481327197_10217"><<</span><span id="yui_3_16_0_1_1468481327197_10218">"SD</span><span id="yui_3_16_0_1_1468481327197_10219"> </span><span id="yui_3_16_0_1_1468481327197_10220">Result</span><span id="yui_3_16_0_1_1468481327197_10221"> </span><span id="yui_3_16_0_1_1468481327197_10222">=</span><span id="yui_3_16_0_1_1468481327197_10223"> </span><span id="yui_3_16_0_1_1468481327197_10224">"</span><span id="yui_3_16_0_1_1468481327197_10225"> </span><span id="yui_3_16_0_1_1468481327197_10226"><<</span><span id="yui_3_16_0_1_1468481327197_10227"> </span>SD<span id="yui_3_16_0_1_1468481327197_10228"> </span><span id="yui_3_16_0_1_1468481327197_10229"><<</span>endl<span id="yui_3_16_0_1_1468481327197_10230">;</span></pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;" id="yui_3_16_0_1_1468481327197_10231"><span style=" color:#c0c0c0;" id="yui_3_16_0_1_1468481327197_10232"> </span><span style=" color:#008000;" id="yui_3_16_0_1_1468481327197_10235">//Mutual</span><span style=" color:#c0c0c0;" id="yui_3_16_0_1_1468481327197_10236"> </span><span style=" color:#008000;" id="yui_3_16_0_1_1468481327197_10237">Information</span></pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;" id="yui_3_16_0_1_1468481327197_10238"><span style=" color:#c0c0c0;" id="yui_3_16_0_1_1468481327197_10239"> </span><span style=" color:#c0c0c0;" id="yui_3_16_0_1_1468481327197_10241"> </span><span id="yui_3_16_0_1_1468481327197_10242">MIF_T::Pointer</span><span id="yui_3_16_0_1_1468481327197_10243"> </span><span id="yui_3_16_0_1_1468481327197_10244">MI_F</span><span id="yui_3_16_0_1_1468481327197_10245"> </span><span id="yui_3_16_0_1_1468481327197_10246">=</span><span id="yui_3_16_0_1_1468481327197_10247"> </span><span id="yui_3_16_0_1_1468481327197_10248">MIF_T::New();</span></pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;" id="yui_3_16_0_1_1468481327197_10249"><span id="yui_3_16_0_1_1468481327197_10250"> </span><span id="yui_3_16_0_1_1468481327197_10252"> </span><span id="yui_3_16_0_1_1468481327197_10253">MI_F->SetFixedImage</span><span id="yui_3_16_0_1_1468481327197_10254"> </span><span id="yui_3_16_0_1_1468481327197_10255">(Imga->GetOutput(0));</span></pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;" id="yui_3_16_0_1_1468481327197_10256"><span id="yui_3_16_0_1_1468481327197_10257"> </span><span id="yui_3_16_0_1_1468481327197_10259"> </span><span id="yui_3_16_0_1_1468481327197_10260">MI_F->SetMovingImage(Imgb->GetOutput(0));</span></pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;" id="yui_3_16_0_1_1468481327197_10261"><span id="yui_3_16_0_1_1468481327197_10262"> </span><span id="yui_3_16_0_1_1468481327197_10263">float</span><span id="yui_3_16_0_1_1468481327197_10264"> </span><span id="yui_3_16_0_1_1468481327197_10265">MI=MI_F->GetValue()</span><span id="yui_3_16_0_1_1468481327197_10266"> </span><span id="yui_3_16_0_1_1468481327197_10267">;</span></pre><div id="yui_3_16_0_1_1468481327197_9839" dir="ltr">
</div><pre style="margin-top: 0px; margin-bottom: 0px;" id="yui_3_16_0_1_1468481327197_10268"><span id="yui_3_16_0_1_1468481327197_10269"> </span><span id="yui_3_16_0_1_1468481327197_10270">cout<<"MI</span><span id="yui_3_16_0_1_1468481327197_10271"> </span><span id="yui_3_16_0_1_1468481327197_10272">Result</span><span id="yui_3_16_0_1_1468481327197_10273"> </span><span id="yui_3_16_0_1_1468481327197_10274">=</span><span id="yui_3_16_0_1_1468481327197_10275"> </span><span id="yui_3_16_0_1_1468481327197_10276">"</span><span id="yui_3_16_0_1_1468481327197_10277"> </span><span id="yui_3_16_0_1_1468481327197_10278"><<</span><span id="yui_3_16_0_1_1468481327197_10279"> </span><span id="yui_3_16_0_1_1468481327197_10280">MI</span><span id="yui_3_16_0_1_1468481327197_10281"> </span><span id="yui_3_16_0_1_1468481327197_10282"><<endl;</span><!--EndFragment--></pre><pre style="margin-top: 0px; margin-bottom: 0px;" id="yui_3_16_0_1_1468481327197_10268"><span><br></span></pre><pre style="margin-top: 0px; margin-bottom: 0px;" id="yui_3_16_0_1_1468481327197_10268"><span style="font-family: HelveticaNeue-Light, 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;" id="yui_3_16_0_1_1468481327197_10803"> </span><span style="font-family: HelveticaNeue-Light, 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;" id="yui_3_16_0_1_1468481327197_10804">but I keep getting these errors:</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;" id="yui_3_16_0_1_1468481327197_10268"> error: no matching function for call to 'itk::MeanSquaresImageToImageMetric<itk::Image<unsigned char, 3u>, itk::Image<unsigned char, 3u> >::GetValue()'<br id="yui_3_16_0_1_1468481327197_10805"></pre><pre style="margin-top: 0px; margin-bottom: 0px;" id="yui_3_16_0_1_1468481327197_10268"><span id="yui_3_16_0_1_1468481327197_10758"> float SD=SD_F->GetValue() ; ^<br></span></pre><pre style="margin-top: 0px; margin-bottom: 0px;" id="yui_3_16_0_1_1468481327197_10268"><span id="yui_3_16_0_1_1468481327197_10857">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;" id="yui_3_16_0_1_1468481327197_10268"><span style="font-family: HelveticaNeue-Light, 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;" id="yui_3_16_0_1_1468481327197_10968">Could you please suggest a correction.</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;" id="yui_3_16_0_1_1468481327197_10268"><span style="font-family: HelveticaNeue-Light, 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;" id="yui_3_16_0_1_1468481327197_10969">Have a nice day!</span><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;" id="yui_3_16_0_1_1468481327197_10268"><font face="HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif" id="yui_3_16_0_1_1468481327197_10957">Ibraheem</font></pre></div></body></html>