<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Hi Brian,<br>
      <br>
      I'm not sure there is a need to fix v3 or to implement the
      optimizer in v4. "Fixing" v3 would break a lot of people's code
      (need to adjust the parameters after the change). As for v4, you
      seem to say that better optimizers should be used instead, so why
      port the old one? For me the most important thing to do was to
      post something on the mailing list, so that if other people
      encounter the problem, they will know they are not alone :)<br>
      <br>
      About the v4 optimizers: what are the recommended v4 optimizers
      for rigid and affine (3D) registration? Are there any reference
      examples available? I couldn't find anything in the "Examples"
      directory of ITK.<br>
      <br>
      Thanks again,<br>
      <br>
      joel<br>
      <br>
      On 13/05/2013 20:53, brian avants wrote:<br>
    </div>
    <blockquote
cite="mid:CABWzF4Wb0zMjTR2=hDP9Lw4Q4cx9K6MsCAx51oa23bS9wZrXMg@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <p>Hi joel</p>
        <p>I think its clear ... do you want to implement this approach
          in v4 ? &nbsp; the "regular step" type behavior is what we achieve
          by other&nbsp;methods in v4 - i.e. the steps detailed to you
          previously. &nbsp; we can help with a v4 implementation of the v3
          version, if you like.&nbsp;</p>
        <p style="">if you prefer to fix v3 then, as brad said, there
          are several tests that will need adjustment. &nbsp;am sure someone
          would help with that too.</p>
        <p style="">b</p>
        <p>---------- Forwarded message ----------</p>
        <div class="gmail_quote">
          From: "Jo&euml;l Schaerer" &lt;<a moz-do-not-send="true"
            href="mailto:joel.schaerer@gmail.com" target="_blank">joel.schaerer@gmail.com</a>&gt;<br>
          Da
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div text="#000000" bgcolor="#FFFFFF">
              <div>Hi Nick,<br>
                <br>
                What I called the "first scaling" is the application of
                scales that is done before gradient normalization, in
                the AdvanceOneStep method:<br>
                <br>
                itkRegularStepGradientDescentBaseOptimizer.cxx<br>
                187&nbsp;&nbsp; for ( unsigned int i = 0; i &lt; spaceDimension;
                i++ )<br>
                188&nbsp;&nbsp;&nbsp;&nbsp; {<br>
                189&nbsp;&nbsp;&nbsp;&nbsp; transformedGradient[i]&nbsp; = m_Gradient[i] /
                scales[i];<br>
                190&nbsp;&nbsp;&nbsp;&nbsp; previousTransformedGradient[i] =<br>
                191&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_PreviousGradient[i] / scales[i];<br>
                192&nbsp;&nbsp;&nbsp;&nbsp; }<br>
                <br>
                The "second scaling" would be my proposed change,
                replacing <br>
                <br>
                itkRegularStepGradientDescentOptimizer.cxx<br>
                &nbsp;42&nbsp;&nbsp; for ( unsigned int j = 0; j &lt; spaceDimension;
                j++ )<br>
                &nbsp;43&nbsp;&nbsp;&nbsp;&nbsp; {<br>
                &nbsp;44&nbsp;&nbsp;&nbsp;&nbsp; newPosition[j] = currentPosition[j] +
                transformedGradient[j] * factor;<br>
                &nbsp;45&nbsp;&nbsp;&nbsp;&nbsp; }<br>
                &nbsp;46<br>
                <br>
                with<br>
                <br>
                itkRegularStepGradientDescentOptimizer.cxx<br>
                &nbsp;42&nbsp;&nbsp; for ( unsigned int j = 0; j &lt; spaceDimension;
                j++ )<br>
                &nbsp;43&nbsp;&nbsp;&nbsp;&nbsp; {<br>
                &nbsp;44&nbsp;&nbsp;&nbsp;&nbsp; newPosition[j] = currentPosition[j] +
                transformedGradient[j] * factor&nbsp; / scales[j];<br>
                &nbsp;45&nbsp;&nbsp;&nbsp;&nbsp; }<br>
                &nbsp;46<br>
                <br>
                basically a second application of the parameter scales.<br>
                <br>
                I hope this is clearer?<br>
                <br>
                joel<br>
                <br>
                On 07/05/2013 23:22, Nick Tustison wrote:<br>
              </div>
              <blockquote type="cite"> Hi Joel,
                <div><br>
                </div>
                <div>Also, could you clarify your question a bit? &nbsp;The
                  snippet of interest in&nbsp;</div>
                <div>the old itkRegularStepGradientOptimizer is</div>
                <div><br>
                </div>
                <div>
                  <div>&nbsp; for(unsigned int j=0; j&lt;spaceDimension; j++)</div>
                  <div>&nbsp; &nbsp; {</div>
                  <div>&nbsp; &nbsp; newPosition[j] = currentPosition[j] +
                    transformedGradient[j] * factor;</div>
                  <div>&nbsp; &nbsp; }</div>
                </div>
                <div><br>
                </div>
                <div>When you write of "first scaling"&nbsp;are you referring
                  to multiplication by&nbsp;</div>
                <div>"factor"?&nbsp;</div>
                <div><br>
                </div>
                <div>Nick</div>
                <div><br>
                </div>
                <br>
              </blockquote>
              <br>
            </div>
          </blockquote>
        </div>
      </div>
    </blockquote>
    <br>
  </body>
</html>