[Insight-users] grid spacing with BSplineDeformableRegistration

Luis Ibanez luis.ibanez at kitware.com
Tue Nov 30 10:47:40 EST 2004


Hi Kristina,


Thanks for pointing this out.

I would rather suggest you to use the second solution,
since the purpose of the spacing computation is not
to end up with an integer spacing in the BSpline grid,
but to make sure that the spacing of the BSpline grid
is an integer multiple of the image spacing.

We should fix the computation in the BSplineWarping1.cxx
example, since it will work badly if somebody uses an
input image with pixel spacing = 0.001, and a BSpline
grid that has 1 image pixels per grid square. (e.g. the
grid spacing in that case will be wrongly computed
as == zero ).


Please let us know if you have further questions,



    Thanks


       Luis



--------------------------
Kristina Grunewald wrote:

> 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
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 
> 






More information about the Insight-users mailing list