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

motes motes mort.motes at gmail.com
Wed Sep 16 10:20:28 EDT 2009


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


More information about the Insight-users mailing list