[Insight-developers] bug in BSplineDeformableTransform?
Luis Ibanez
luis.ibanez at kitware.com
Mon Mar 24 14:17:44 EDT 2008
Hi Tomas,
Thanks for looking that the status of this class.
I'm surprised that the bug tracker doesn't let you add comments
when a bug is marked as "resolved". In any case, I move the bug
status back to "confirmed" and copy/pasted the content of your email:
http://public.kitware.com/Bug/view.php?id=4021
BTW: Something I may have to fail to mention in my previous
email, is that the fix that was originally proposed in
the bug report didn't work when we tried with this test.
You bring a very good point regarding the number of nodes that
must be added outside of the image domain.
The BSpline grid doesn't have to have "#Order" nodes *outside*
of the image, *but* no matter how the grid is placed on top
of the image, only the grid cells that are fully contained
inside of the grid will be suitable for interpolation.
The definition of "fully contained" is subject to the order
of the spline. That is, regardless of how we place the bspline
grid on top of the image, for a grid of N nodes we can only
interpolate in a region that is ( N - Bo ) grid cells.
[where Bo = BSpline order].
---
I modified the test according to your suggestion, and also
created new text input files with the appropriate number of
grid node inputs.
With this new arrangement, the images still look smooth
after resampling.
Could you please try running this on your image again,
and let us know if the resampling is smooth in that case ?
Thansk a lot for the feedback,
Luis
-------------------
Tomáš Kazmar wrote:
> 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