<br>Hi Pinpress,<br><br>One of  the many pleasures of using Open Source software<br>is that you can see what the software does, just by reading<br>the source code.<br><br><br>If you open in an editor the file:<br><br><br>Insight/Code/Algorithms/<br>
  itkCorrelationCoefficientHistogramImageToImageMetric.txx<br><br><br>and looks at lines 28-34<br><br><br>::EvaluateMeasure(HistogramType&amp; histogram) const<br>{<br>  const MeasureType varianceX  = this-&gt;VarianceX(  histogram );<br>
  const MeasureType varianceY  = this-&gt;VarianceY(  histogram );<br>  const MeasureType covariance = this-&gt;Covariance( histogram );<br>  return vcl_fabs(covariance /( vcl_sqrt(varianceX )* vcl_sqrt(varianceY )));<br>
}<br><br><br>Which is equivalent to the &quot;correlation coefficient&quot;  p(x,y) as defined <br>in page 5 of the article that you kindly sent, but it is not equivalent <br>to the &quot;correlation ratio&quot; as defined in equation (3) in page 4.<br>
<br><br>In order to make them equivalent you need to compute<br><br>                                         E(Y/X)<br><br>for every value of X.<br><br>You can get this from the Joint histogram of Y and X values<br>by computing the average of Y values for a given value of X.<br>
<br>once you have those values stored in an Array, you can<br>easily compute<br><br>                        Var(  Y - E(Y/X) )  /  Var( Y )<br><br>You could do this by modifying the code of the existing<br><br>itkCorrelationCoefficientHistogramImageToImageMetric.txx<br>
<br><br>and of course, we strongly encourage you to contribute that<br>new class to the Insight Journal<br><br>            <a href="http://www.insight-journal.org">http://www.insight-journal.org</a><br><br><br>---<br><br>
The class itkCorrelationCoefficientHistogramImageToImageMetric.<br>was added to ITK on August  2003:<br><br>
<a href="http://public.kitware.com/cgi-bin/viewcvs.cgi/Code/Algorithms/itkCorrelationCoefficientHistogramImageToImageMetric.txx?root=Insight&amp;view=log">http://public.kitware.com/cgi-bin/viewcvs.cgi/Code/Algorithms/itkCorrelationCoefficientHistogramImageToImageMetric.txx?root=Insight&amp;view=log</a><br>

<br>
<br>Therefore, <br>it has been in ITK even before the ITK 2.2 release:<br>
<br>
<a href="http://www.itk.org/Wiki/ITK_Previous_Releases">http://www.itk.org/Wiki/ITK_Previous_Releases</a><br>
<br>
---<br><br>Note that the class<br><br>itkNormalizedCorrelationImageToImageMetric<br><br>is described in the ITK Software Guide<br><br>    <a href="http://www.itk.org/ItkSoftwareGuide.pdf">http://www.itk.org/ItkSoftwareGuide.pdf</a><br>
<br><br>and you can see its computation in the file:<br><br>Insight/Code/Algorithms/<br>
  itkNormalizedCorrelationImageToImageMetric.txx<br>
<br>in lines 94 -128<br><br>which are equivalent to<br><br>              Var(  X * Y ) / Var( X ) * Var( Y )<br>                   <br>and therefore, not really the &quot;correlation ratio&quot; that<br>is defined in the paper.<br>
<br><br>     Regards,<br><br><br>            Luis<br><br><br>-----------------------------------------------------------------------------------------<br><div class="gmail_quote">On Tue, Apr 20, 2010 at 2:07 PM, pinpress <span dir="ltr">&lt;<a href="mailto:sb_ji@yahoo.com">sb_ji@yahoo.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Hi,<br>
<br>
I am in need to perform registration in ITK using correlation ratio as image<br>
similarity measure (Its reference can be found here:<br>
<a href="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.20.1164&amp;rep=rep1&amp;type=pdf" target="_blank">http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.20.1164&amp;rep=rep1&amp;type=pdf</a><br>
). I found from ITK classes the following two:<br>
<br>
CorrelationCoefficientHistogramImageToImageMetric<br>
<br>
NormalizedCorrelationImageToImageMetric<br>
<br>
My question is, do they implement the &quot;correlation ratio&quot; as similarity<br>
measure? What are their differences? Thanks very much.<br>
<font color="#888888">--<br>
View this message in context: <a href="http://old.nabble.com/Are-these-metrics-based-on-%22correlation-ratio%22--tp28287905p28287905.html" target="_blank">http://old.nabble.com/Are-these-metrics-based-on-%22correlation-ratio%22--tp28287905p28287905.html</a><br>

</font><div class="im">Sent from the ITK - Users mailing list archive at Nabble.com.<br>
<br>
_____________________________________<br>
</div><div><div></div><div class="h5">Powered by <a href="http://www.kitware.com" 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" 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.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
</div></div></blockquote></div><br>