[Insight-users] Cubic BSpline kernel Theory?

Luis Ibanez luis.ibanez at kitware.com
Sat Oct 17 18:57:14 EDT 2009


Hi Motes:


From
http://en.wikipedia.org/wiki/B-spline#Uniform_cubic_B-splines

the product:

           (1/6) . [t^3  t^2  t 1] . M

where the Matrix M is:

|  -1   3   -3   1  |
|   3   -6   3   0  |
|  -3   0    3   0  |
|   1   4    1   0  |

results in the following columns:

a)  (1/6)( -t^3   +3t^2  -3t   +1)

b)  (1/6)( 3t^3   -6t^2  +0t  +4 )

c)  (1/6) (-3t^3  + 3t^2 -3t + 1 )

d)  (1/6). t^3

that are the weights with with every point in the
set of four points will contribute to the interpolation.

If you take column (b) you get

     ( 3 t^3    -6 t^2  + 4 ) / 6

that is equal to

    ( 4   -6 t^2  +  3 t^3  ) / 6


which is the same as the ITK code:

 ( 4.0 - 6.0 * sqrValue + 3.0 * sqrValue * absValue ) / 6.0;


The second term, for the range   1 <= x < 2,
is the result of taking column (d):

        (1/6 )  t^3

and shifting it two units to the right and negating it:

     - 1.0  * ( 1 / 6 ) * ( t - 2 ) ^3

which is equal to

   -1.0 *  ( 1 / 6 ) * ( t^3 - 3 t^2 * 2 + 3 * t * 2^2 -  2^3 )

   -1.0 *  ( 1 / 6 ) * ( t^3  - 6 t^2  + 12 * t  - 8 )

            ( 8   -  12 * t    + 6 * t^2  - t^3  )  /  6


Which is the same as the C++ expression :

( 8.0 - 12 * absValue + 6.0 * sqrValue -
                                            sqrValue * absValue ) / 6.0;

In lines 155-156 of

Insight/Code/Common/itkBSplineKernelFunction.h


Plotting the equations with GNUPlot (or any other plotting
application) will help you visualize how is that this piece-wise
defined polynomials are composed together to produce a
smooth (C1) kernel.


      Regards,


             Luis


-------------------------------------------------------------------------------------
On Tue, Oct 13, 2009 at 6:37 AM, motes motes <mort.motes at gmail.com> wrote:
> I recognize the expression from the wiki page. But how does the itk kernel:
>
>
>  double absValue = vnl_math_abs( u );
>  double sqrValue = vnl_math_sqr( u );
>
>  if ( absValue  < 1.0 ) {
>   return ( 4.0 - 6.0 * sqrValue + 3.0 * sqrValue * absValue ) / 6.0;
>  } else if ( absValue < 2.0 ) {
>   return ( 8.0 - 12 * absValue + 6.0 * sqrValue - sqrValue * absValue ) / 6.0;
>  } else {
>   return 0.0;
>  }
> }
>
> relate to the expression on wiki? When I write the itk kernel out I get:
>
>
> 4/6 - u^2 + 1/2*u^3          : u<1
> 4/3 - 2*u + u^2 - u^3/6     : u<2
>
> I can't really see the connection between this expression and the
> basis matrix from the wiki page.
>
>
>
>
>
>
> On Tue, Oct 13, 2009 at 12:39 AM, Luis Ibanez <luis.ibanez at kitware.com> wrote:
>> Hi Mottes:
>>
>>
>> You may find useful to look at the following tutorial:
>> http://www.na-mic.org/Wiki/images/0/06/Insight-DeformableRegistration-BSplines.ppt
>>
>> It will explain you how to derive the equations by performing
>> successive convolutions with basic kernels.
>>
>>
>> You will also find the explicit expression
>> for cubic B-Splines in the Wikipedia:
>> http://en.wikipedia.org/wiki/B-spline#Uniform_cubic_B-splines
>>
>>
>>   Regards,
>>
>>
>>     Luis
>>
>>
>> ----------------------------------------------------------------------------------
>> On Mon, Oct 12, 2009 at 4:11 PM, motes motes <mort.motes at gmail.com> wrote:
>>> In the BSplineDeformableTransform a BSpline kernel is used which in
>>> the Cubic case is:
>>>
>>> ::BSplineKernel( const double & u) const
>>> {
>>>  double absValue = vnl_math_abs( u );
>>>  double sqrValue = vnl_math_sqr( u );
>>>
>>>  if ( absValue  < 1.0 ) {
>>>    return ( 4.0 - 6.0 * sqrValue + 3.0 * sqrValue * absValue ) / 6.0;
>>>  } else if ( absValue < 2.0 ) {
>>>    return ( 8.0 - 12 * absValue + 6.0 * sqrValue - sqrValue * absValue ) / 6.0;
>>>  } else {
>>>    return 0.0;
>>>  }
>>> }
>>>
>>> But where does this expression come from? In the BSpline litterature I
>>> have only found the basis functions expressed using the Cox De Boor
>>> recursion formula. Where can I read up on the above explicit
>>> expression?
>>> _____________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.itk.org/mailman/listinfo/insight-users
>>>
>>
>


More information about the Insight-users mailing list