<br>Hi Motes,<br><br><br> Yes, you got it all right !<br><br><br>This example is evaluating the Metric between<br>one image and different translations of itself.<br><br>You should find that the lowest metric value <br>
correspond to the displacement (0,0).<br><br>The purpose of the exercise is to visualize<br>the cost function (the Image Metric) for <br>values in a grid of 50 x 50 positions in the<br>parametric space.<br><br>That's the kind of space that the Optimizers<br>
will have to navigate.<br><br><br> Regards,<br><br><br> Luis<br><br><br>--------------------------------------------------------<br><div class="gmail_quote">On Wed, Jul 1, 2009 at 4:27 PM, motes motes <span dir="ltr"><<a href="mailto:mort.motes@gmail.com">mort.motes@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;">I am trying the metric example in the itkSoftwareGuide page 416. This is what I understand so far:<br>
<br>The following components are connected to the SSD metric:<br><br>- Transform (translation)<br>- Interpolator (nearest neighbor)<br>
- The fixed and moving images, in the example they are identical.<br><br>Next the moving image is translated and for each translation the metric is computed:<br><br> const int rangex = 50;<br> const int rangey = 50;<br>
for(int dx = -rangex; dx <= rangex; dx++){<br> for(int dy = -rangey; dy <= rangey; dy++){<br> displacement[0] = dx;<br> displacement[1] = dy;<br> const double value = metric->GetValue(displacement);<br>
out << dx << " " << dy << " " << value << std::endl;<br> }<br> }<br><br>As I understand the call:<br><br> metric->GetValue(displacement);<br>
<br>evaluates the metric for transform parameters contained in the displacement vector using the underlying connected transform.<br><br>Eg when dx=dy=50 we are actually testing how good the transform that translates all pixels 50 units along the x and y axis aligns with the fixed image - which is not very good. The optimal solution is a transform that translates all pixels 0 units along the x and y axis which makes sense since the two images are identical.<br>
<br>To put it another way: The fixed image is compared to 50*50 translated versions of it self. <br><br>Am I on the right track?<br>
<br>_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at: <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br>