[Insight-users] correlation coefficient histogram metric on 2 images

Karthik Krishnan karthik.krishnan at kitware.com
Fri Jun 4 23:38:14 EDT 2010


On Fri, Jun 4, 2010 at 7:38 PM, Zoltan Seress <seress.zoltan at gmail.com>wrote:

> Hi all,
>
> 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?
>

You can use the metric classes independent of the registration process. You
need initialize it properly..

Something like this should work:

  MetricType::Pointer metric = MetricType::New();
  metric->SetFixedImage( image1 );
  metric->SetMovingImage( image2 );

  typedef itk::IdentityTransform< double, Dimension >  TransformType;
  TransformType::Pointer transform = TransformType::New();
  metric->SetTransform( transform );

  typedef itk::LinearInterpolateImageFunction<
           ImageType, double > InterpolatorType;
  InterpolatorType::Pointer interpolator  = InterpolatorType::New();
  metric->SetInterpolator( interpolator );

  metric->SetFixedImageRegion( image1->GetBufferedRegion() );
  metric->Initialize();
  const double metricValue = metric->GetValue( transform->GetParameters() );


--
karthik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100605/4df14fd8/attachment.htm>


More information about the Insight-users mailing list