[Insight-users] Are these metrics based on "correlation ratio"?
Luis Ibanez
luis.ibanez at kitware.com
Sun Apr 25 17:53:15 EDT 2010
Hi Pinpress,
One of the many pleasures of using Open Source software
is that you can see what the software does, just by reading
the source code.
If you open in an editor the file:
Insight/Code/Algorithms/
itkCorrelationCoefficientHistogramImageToImageMetric.txx
and looks at lines 28-34
::EvaluateMeasure(HistogramType& histogram) const
{
const MeasureType varianceX = this->VarianceX( histogram );
const MeasureType varianceY = this->VarianceY( histogram );
const MeasureType covariance = this->Covariance( histogram );
return vcl_fabs(covariance /( vcl_sqrt(varianceX )* vcl_sqrt(varianceY
)));
}
Which is equivalent to the "correlation coefficient" p(x,y) as defined
in page 5 of the article that you kindly sent, but it is not equivalent
to the "correlation ratio" as defined in equation (3) in page 4.
In order to make them equivalent you need to compute
E(Y/X)
for every value of X.
You can get this from the Joint histogram of Y and X values
by computing the average of Y values for a given value of X.
once you have those values stored in an Array, you can
easily compute
Var( Y - E(Y/X) ) / Var( Y )
You could do this by modifying the code of the existing
itkCorrelationCoefficientHistogramImageToImageMetric.txx
and of course, we strongly encourage you to contribute that
new class to the Insight Journal
http://www.insight-journal.org
---
The class itkCorrelationCoefficientHistogramImageToImageMetric.
was added to ITK on August 2003:
http://public.kitware.com/cgi-bin/viewcvs.cgi/Code/Algorithms/itkCorrelationCoefficientHistogramImageToImageMetric.txx?root=Insight&view=log
Therefore,
it has been in ITK even before the ITK 2.2 release:
http://www.itk.org/Wiki/ITK_Previous_Releases
---
Note that the class
itkNormalizedCorrelationImageToImageMetric
is described in the ITK Software Guide
http://www.itk.org/ItkSoftwareGuide.pdf
and you can see its computation in the file:
Insight/Code/Algorithms/
itkNormalizedCorrelationImageToImageMetric.txx
in lines 94 -128
which are equivalent to
Var( X * Y ) / Var( X ) * Var( Y )
and therefore, not really the "correlation ratio" that
is defined in the paper.
Regards,
Luis
-----------------------------------------------------------------------------------------
On Tue, Apr 20, 2010 at 2:07 PM, pinpress <sb_ji at yahoo.com> wrote:
>
> Hi,
>
> I am in need to perform registration in ITK using correlation ratio as
> image
> similarity measure (Its reference can be found here:
>
> http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.20.1164&rep=rep1&type=pdf
> ). I found from ITK classes the following two:
>
> CorrelationCoefficientHistogramImageToImageMetric
>
> NormalizedCorrelationImageToImageMetric
>
> My question is, do they implement the "correlation ratio" as similarity
> measure? What are their differences? Thanks very much.
> --
> View this message in context:
> http://old.nabble.com/Are-these-metrics-based-on-%22correlation-ratio%22--tp28287905p28287905.html
> Sent from the ITK - Users mailing list archive at Nabble.com.
>
> _____________________________________
> 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.html
>
> 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://www.itk.org/mailman/listinfo/insight-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100425/44656af7/attachment.htm>
More information about the Insight-users
mailing list