<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><div>Hi,<br><br>&nbsp;&nbsp; I use versor-based 3D rigid registration and gradient descent -based affine registration algos to register two 3D volumes.<br><br>The metric is mean squares and interpolator type is linear.<br><br>To perform a cross-check on the final metric received after registration, I -recompute the metric values as follows :<br><br>1.&nbsp; Grayscale images<br>MetricType::Pointer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; metricOrig&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = MetricType::New();&nbsp;&nbsp;&nbsp; <br>TransformType::Pointer&nbsp; transformOrig = TransformType::New();&nbsp;&nbsp;&nbsp;
 <br><br>metricOrig-&gt;SetInterpolator(interpolator);<br>metricOrig-&gt;SetTransform(transformOrig);<br>metricOrig-&gt;SetFixedImage(fixedImageOrig);<br>metricOrig-&gt;SetMovingImage(movingImageOrig); <br>metricOrig-&gt;SetFixedImageRegion(fixedImageOrig-&gt;GetBufferedRegion());<br>MetricType::TransformParametersType finalParam = registration-&gt;GetLastTransformParameters();<br>metricOrig-&gt;Initialize();&nbsp;&nbsp;&nbsp; <br>std::cout&lt;&lt;"MetricOnOriginalImage = "&lt;&lt;metricOrig-&gt;GetValue(finalParam)&lt;&lt;std::endl;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br><br>For the above code, I get metric values like 50 and 90 (for two different datasets )whereas the bestValue = optimizer-&gt;GetValue()&nbsp; returned by the optimizer (after registration) is 0.70 and 1.70 respectively.<br>How does one explain this ? Especially when the Mean Square Error is the MEAN and not the total error ?<br><br><br><br>2. If the volumes sent to the
 registrator were binary, and the resultant transform is to be applied to binary moving image.<br><br>&nbsp;MetricType::Pointer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; metricBin&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = MetricType::New();&nbsp;&nbsp;&nbsp; <br><br>&nbsp;metricBin-&gt;SetInterpolator(interpolator);<br>&nbsp;metricBin-&gt;SetTransform(transformOrig);<br>&nbsp;metricBin-&gt;SetFixedImage(fixedBinImage);<br>&nbsp;metricBin-&gt;SetFixedImageRegion(fixedImage-&gt;GetBufferedRegion());<br>&nbsp;metricBin-&gt;SetMovingImage(movingBinImage); <br>&nbsp;metricBin-&gt;Initialize();<br>std::cout&lt;&lt;"MetricOnBinImage = "&lt;&lt;metricBin-&gt;GetValue(finalParam)&lt;&lt;std::endl;<br><br><br><br>Then I get values of metric = 958 and 220 (for two different datasets) when the optimizer returns a value of 32 and 90 respectively. <br><br>So my questions are :<br><br>a)&nbsp; How does one explain a MEAN square error of 958 over a
 scale of 0-255 ?<br>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 .<br>c) In an earlier itk posting,<br><span>&nbsp;<a target="_blank" href="http://public.kitware.com/pipermail/insight-users/2005-July/014045.html">http://public.kitware.com/pipermail/insight-users/2005-July/014045.html</a>, Lydia mentions that this would be due to roundoff errors, but it does not explain large differences.</span><br><br>Any clues ?<br><br>Emma<br></div></div><br>
      <hr size=1>Be a better Heartthrob. <a href="http://us.rd.yahoo.com/evt=48255/*http://answers.yahoo.com/dir/_ylc=X3oDMTI5MGx2aThyBF9TAzIxMTU1MDAzNTIEX3MDMzk2NTQ1MTAzBHNlYwNCQUJwaWxsYXJfTklfMzYwBHNsawNQcm9kdWN0X3F1ZXN0aW9uX3BhZ2U-?link=list&sid=396545433">Get better relationship answers </a>from someone who knows.<br>Yahoo! Answers - Check it out. 
</body></html>