[Insight-developers] bug in BSplineDeformableTransform?

Tomáš Kazmar Tomash.Kazmar at seznam.cz
Sun Mar 23 14:11:22 EDT 2008


Hi Luis.

# What we found is that the problem was related to the computation
# of the start index used as the first node of support in the
# BSpline grid.

As I can add no more comments to a resolved bug, I post here.  IMHO, the
patch you decided to use is not correct. The tests shadow the error as they
define the grid, so that it works. The grid is defined the same irrespective
of the spline order. There are five nodes on image and three outside the image
and therefore you need to correct it changing the starting index.

  const unsigned int numberOfGridNodesOutsideTheImageSupport = 3;
  const unsigned int numberOfGridNodesInsideTheImageSupport = 5;
  const unsigned int numberOfGridNodes = 
                        numberOfGridNodesInsideTheImageSupport +
                        numberOfGridNodesOutsideTheImageSupport;
                        
As a user I would expect that I setup the grid with n nodes outside the image
for a spline of order n.

  const unsigned int numberOfGridNodesOutsideTheImageSupport = VSplineOrder;
  const unsigned int numberOfGridNodesInsideTheImageSupport = 5;
  const unsigned int numberOfGridNodes = 
                        numberOfGridNodesInsideTheImageSupport +
                        numberOfGridNodesOutsideTheImageSupport;


Maybe this way has some implementation advantages, say in implementation
of B-spline derivatives, I don't know. So the question: is the
BSplineDeformableTransform meant to be used always with the grid with three
nodes outside the image? Consider this, as after inclusion in ITK, there will
be no way to correct it afterwards because of the backwards compatibility.


Regards,
Tomas


More information about the Insight-developers mailing list