[Insight-users] correlation coefficient histogram metric on 2 images
Zoltan Seress
seress.zoltan at gmail.com
Mon Jun 7 03:08:56 EDT 2010
Hi,
Thank to both of you. Karthik, your solution seems to work!
On Sat, Jun 5, 2010 at 5:38 AM, Karthik Krishnan <
karthik.krishnan at kitware.com> wrote:
> 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
>
>
--
Zoli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100607/5288eb27/attachment.htm>
More information about the Insight-users
mailing list