Hi,<div><br></div><div>Thank to both of you. Karthik, your solution seems to work!<br><br><div class="gmail_quote">On Sat, Jun 5, 2010 at 5:38 AM, Karthik Krishnan <span dir="ltr"><<a href="mailto:karthik.krishnan@kitware.com">karthik.krishnan@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="gmail_quote"><div class="im">On Fri, Jun 4, 2010 at 7:38 PM, Zoltan Seress <span dir="ltr"><<a href="mailto:seress.zoltan@gmail.com" target="_blank">seress.zoltan@gmail.com</a>></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">
Hi all,<div><br></div><div>My problem is very simple. I have 2 images (same size) and I want to compute the correlation coefficient between them. Can itkCorrelationCoefficientHistogramImageToImageMetric class be used for this some way? I do not need any registration process, only the simple CC value between the images. Or does this class need an optimizer to work correctly?</div>
</blockquote></div><div><br>You can use the metric classes independent of the registration process. You need initialize it properly.. <br><br>Something like this should work:<br><br> MetricType::Pointer metric = MetricType::New();<br>
metric->SetFixedImage( image1 );<br> metric->SetMovingImage( image2 );<br><br> typedef itk::IdentityTransform< double, Dimension > TransformType;<br> TransformType::Pointer transform = TransformType::New();<br>
metric->SetTransform( transform );<br><br> typedef itk::LinearInterpolateImageFunction< <br> ImageType, double > InterpolatorType;<br> InterpolatorType::Pointer interpolator = InterpolatorType::New();<br>
metric->SetInterpolator( interpolator );<br> <br> metric->SetFixedImageRegion( image1->GetBufferedRegion() );<br> metric->Initialize();<br> const double metricValue = metric->GetValue( transform->GetParameters() );<br>
<br><br>--<br>karthik</div></div><br>
</blockquote></div><br><br clear="all"><br>-- <br>Zoli<br>
</div>