[Insight-developers] Re: DeformableRegistration7.cxx bug report

Luis Ibanez luis.ibanez at kitware.com
Sat Sep 16 19:26:02 EDT 2006


Hi Simon,

Thanks for pointing this out.

You are right, we were missing to compute the third component
of the displacement.

In fact the expression should have been written just as:

       movingPoint = transform->TransformPoint( fixedPoint );
       displacement = movingPoint - fixedPoint;
       fi.Set( displacement );


given that the itk::Point class offers the subtraction operator,
and therefore allows to write code that is dimension-independent.


The fix has been committed to the CVS repository.


Please let us know if you find any other problem.



    Thanks



       Luis



========================
Simon Warfield wrote:
> There is a bug in the displacement field computation in the example.
> The 3D field is treated as a 2D field, perhaps because the 3D example 
> was based on a 2D example.
> 
> Around line 495, the file says:
>        displacement[0] = movingPoint[0] - fixedPoint[0];
>        displacement[1] = movingPoint[1] - fixedPoint[1];
> but the displacement field in this example is in 3D.  The 
> displacement[2] should also be updated e.g.
>        for (unsigned int i = 0; i < ImageDimension; i++) {
>        displacement[i] = movingPoint[i] - fixedPoint[i];
>      }
> or by adding
>     displacement[2] = movingPoint[2] - fixedPoint[2];
> 




More information about the Insight-developers mailing list