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 &lt;= rangex; dx++){<br>      for(int dy = -rangey; dy &lt;= rangey; dy++){<br>        displacement[0] = dx;<br>        displacement[1] = dy;<br>        const double value = metric-&gt;GetValue(displacement);<br>
        out &lt;&lt; dx &lt;&lt; &quot;   &quot;  &lt;&lt; dy &lt;&lt; &quot;   &quot; &lt;&lt; value &lt;&lt; std::endl;<br>      }<br>    }<br><br>As I understand the call:<br><br>  metric-&gt;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>