[Insight-users] question for itkMeanSquaresImageToImageMetric

Luis Ibanez luis.ibanez@kitware.com
Mon, 31 Mar 2003 22:06:57 -0500


Hi Sean,


Short answer:

    Yes, the MeanSquaresImageToImageMetric
    does take into account the image spacing.



Long answer:

The MeanSquaresImageToImageMetric obtains the derivative of the
metric by multiplying the gradient of the image with the jacobian
of the transformation.

The gradient of the image is computed using the

        GradientRecursiveGaussianImageFilter

This filter takes into account the image spacing when it is
computing the gradient.  Henceforth the image spacing is propagated
to the MetricDerivative.

The particular piece of code that you refer is simply finding
the closest pixel in the gradient image, to the point mapped
by the transform.


  Regards,


    Luis


---------------------------------------------------------
Zhiyong Xie wrote:
> I got a question for source code of itkMeanSquaresImageToImageMetric.txx.
> In function GetDerivative and GetValueAndDerivative, the index of gradient
> image was computed as follows:
> /**** source code*/
> typename Superclass::OutputPointType tempPoint =
>               movingImageTransform->TransformPoint( transformedPoint );
> 
>      typename MovingImageType::IndexType mappedIndex;
>      for( unsigned int j = 0; j < MovingImageType::ImageDimension; j++ )
>        {
>        mappedIndex[j] = static_cast<long>( vnl_math_rnd( tempPoint[j] ) );
>        }
> 
>      const GradientPixelType gradient =
>                                m_GradientImage->GetPixel( mappedIndex );
> 
> /***  *  */
> 
> If the image spacing is not 1 (say 0.8), doese it generate correct result?
> 
> Thanks
> 
> Sean
> 
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-users
>