[Insight-users] grid spacing with BSplineDeformableRegistration

Kristina Grunewald k.grunewald at dkfz-heidelberg.de
Tue Nov 30 04:58:44 EST 2004


Hello,

I found two different ways how to compute the spacing of a bspline grid 
transform in the existing code.
In Examples/Registration/BSplineWarping1.cxx it is done like that:

spacing[x] = floor( fixedSpacing[x] * (fixedImageSize[x] - 1) / 
(gridSizeOnImage[x] - 1) );

Whereas in Examples/Registration/DeformableRegistration4.cxx like:

spacing[x] = fixedSpacing[x];
spacing[x] *= floor( static_cast<double>(fixedImageSize[x] - 1)  /
      static_cast<double>(gridSizeOnImage[x] - 1) );

The rounding in the first case is done after having multiplied with the 
fixed image spacing, in the latter before.
This may result in different values, set fixedImageSize[x] = 44, 
fixedSpacing[x] = 4, and gridSizeOnImage[x] = 10.

I prefer the first solution but I am not quite sure whether this is correct.

Thanks,
Kristina


More information about the Insight-users mailing list