[Insight-users] Mean Squares Metric Computation does not match
Emma Ryan
eryanvtk at yahoo.com
Tue Aug 14 14:01:58 EDT 2007
Hi,
I use versor-based 3D rigid registration and gradient descent -based affine registration algos to register two 3D volumes.
The metric is mean squares and interpolator type is linear.
To perform a cross-check on the final metric received after registration, I -recompute the metric values as follows :
1. Grayscale images
MetricType::Pointer metricOrig = MetricType::New();
TransformType::Pointer transformOrig = TransformType::New();
metricOrig->SetInterpolator(interpolator);
metricOrig->SetTransform(transformOrig);
metricOrig->SetFixedImage(fixedImageOrig);
metricOrig->SetMovingImage(movingImageOrig);
metricOrig->SetFixedImageRegion(fixedImageOrig->GetBufferedRegion());
MetricType::TransformParametersType finalParam = registration->GetLastTransformParameters();
metricOrig->Initialize();
std::cout<<"MetricOnOriginalImage = "<<metricOrig->GetValue(finalParam)<<std::endl;
For the above code, I get metric values like 50 and 90 (for two different datasets )whereas the bestValue = optimizer->GetValue() returned by the optimizer (after registration) is 0.70 and 1.70 respectively.
How does one explain this ? Especially when the Mean Square Error is the MEAN and not the total error ?
2. If the volumes sent to the registrator were binary, and the resultant transform is to be applied to binary moving image.
MetricType::Pointer metricBin = MetricType::New();
metricBin->SetInterpolator(interpolator);
metricBin->SetTransform(transformOrig);
metricBin->SetFixedImage(fixedBinImage);
metricBin->SetFixedImageRegion(fixedImage->GetBufferedRegion());
metricBin->SetMovingImage(movingBinImage);
metricBin->Initialize();
std::cout<<"MetricOnBinImage = "<<metricBin->GetValue(finalParam)<<std::endl;
Then I get values of metric = 958 and 220 (for two different datasets) when the optimizer returns a value of 32 and 90 respectively.
So my questions are :
a) How does one explain a MEAN square error of 958 over a scale of 0-255 ?
b) For the binary images, when I compute the mean square error using other softwares, I get a value of 5. Whereas ITK optimizer returns the final metric value at 32. Both softwares use linear interpolator. I dont think I should get such huge differences even if I were to uses nearest neighbor .
c) In an earlier itk posting,
http://public.kitware.com/pipermail/insight-users/2005-July/014045.html, Lydia mentions that this would be due to roundoff errors, but it does not explain large differences.
Any clues ?
Emma
____________________________________________________________________________________
Sick sense of humor? Visit Yahoo! TV's
Comedy with an Edge to see what's on, when.
http://tv.yahoo.com/collections/222
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20070814/d2490663/attachment.html
More information about the Insight-users
mailing list