[Insight-users] DeformableRegistration4 (Correction)

Luis Ibanez luis.ibanez at kitware.com
Mon Dec 19 11:56:24 EST 2005


Hi Gary,

The purpose of that computation is to find a spacing
that will make the BSpline grid to have cells with a
size that is integer multiples of the image cells size.

In other words, we are trying to make sure that the
BSpline nodes overlap to image grid nodes. This makes
possible to simplify the computation of the support
area of evey single BSpline grid node.

You are right in your observation that by using "floor"
it is possible that the BSpline grid nodes will fall
inside the image, but note that on that side of the
BSpline grid, there are two extra grid nodes, so even
if the one in the border of the image falls inside the
image, the two others will still be outside.

You could replace "floor" with a static_cast (truncation)
or with "ceil" is you find that more convenient.

As long as you are not using a very dense BSpline grid,
this will probably not have any significant difference.


   Regards,



      Luis



-------------------
gary lazer wrote:
> Correction to my previous email: I think I figured out
> the purpose of the multiplication. I'm still confused
> though why the floor function is needed.
> Thanks,
> Gary
> 
> --- gary lazer <gary.lazer at yahoo.com> wrote:
> 
> 
>>Hi,
>>
>>I have a question about a few lines in the example
>>DeformableRegistration4.cxx. When setting the
>>spacing
>>of the bspline grid the spacing is set using:
>>
>>    spacing[r] *= floor(
>>static_cast<double>(fixedImageSize[r] - 1)  /
>>                 
>>static_cast<double>(gridSizeOnImage[r] - 1) );
>>
>>I'm confused as to why the 'floor' function is used
>>and why the right side is multiplied by spacing[r].
>>Won't this result in the upper 2 grid nodes
>>sometimes falling inside the image region? Shouldn't
>>the following be used
>>instead:
>>
>>    spacing[r] =
>>static_cast<double>(fixedImageSize[r]
>>- 1)  /
>>                 
>>static_cast<double>(gridSizeOnImage[r] - 1);
>>
>>This way the 2 grid notes at the upper border will
>>always fall outside the
>>image region. Any help would be appreciated.
>>
>>Thanks, Gary
>>
>>
>>
>>__________________________________________________
>>Do You Yahoo!?
>>Tired of spam?  Yahoo! Mail has the best spam
>>protection around 
>>http://mail.yahoo.com 
>>_______________________________________________
>>Insight-users mailing list
>>Insight-users at itk.org
>>http://www.itk.org/mailman/listinfo/insight-users
>>
> 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> _______________________________________________
> 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