[Insight-users] Computing the gradient in the Metric - part two?

Luis Ibanez luis.ibanez at kitware.com
Thu Sep 17 06:30:19 EDT 2009


Hi Motes,

1)  Yes, "diff" is the difference of intensity between
     a given pixel of the fixed image and its associated
     pixel in the moving image.

2)  and, yes, "diff" is a constant in the for() loop
     that is driven by the variable: "par".

3)  The parameter "par" selects different columns
     from the Jacobian matrix.

4)  It is reasonable to expect that "sum" will only
     be zero in the first iteration of the loop of "par".

     However, please note that if your image has
     Null gradients in certain regions, then it is
     perfectly possible for "sum" to be null during
     all the iterations.

     It is also possible for "sum" to remain equal
     to zero for all the "par" elements of the Transform
     parameters array for which the current pixel
     locations are a "fixed point" (in the geometrical
     sense).  For example, if your transform is a
     rotation, and you are currently evaluating a
     pixel that happens to be located at the center
     of rotation.



   Regards,


         Luis


------------------------------------------------------------
On Wed, Sep 16, 2009 at 10:20 AM, motes motes <mort.motes at gmail.com> wrote:
> In the metric the gradient is computed with:
>
> for (each pixel ) {
>
> ...
> ...
>     for(unsigned int par=0; par<ParametersDimension; par++)
>        {
>        RealType sum = NumericTraits< RealType >::Zero;
>        for(unsigned int dim=0; dim<ImageDimension; dim++)
>          {
>          sum += 2.0 * diff * jacobian( dim, par ) * gradient[dim];
>          }
>        derivative[par] += sum;
>        }
>
> }
>
> As I understand the 'diff' and 'gradient' is calculated once per pixel
> and are therefore constant in the inner loop above.
>
> Its only the jacobian values that changes depending on the parameters visited.
>
> Is it correct that sum will only be non-zero in one iteration in the
> inner loop ? For a given parameter/column in the Jacobian only one
> cell will be non-zero corresponding to the component (x,y,z) for the
> parameter.
>
>
>
>
>
>
> But in the inner loop
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>


More information about the Insight-users mailing list