[Insight-developers] bug in BSplineDeformableTransform?

Tomáš Kazmar Tomash.Kazmar at seznam.cz
Wed Mar 19 08:16:38 EDT 2008


Hi Stefan,

  thanks for sending the link, I attached some more info to the bug report and
hopefully the right way to patch it.

Regards,
Tomas


# Hi Tomas,
# 
# This seems to be the same problem as bug 4021, which i reported a while ago.
# 
# http://www.itk.org/Bug/view.php?id=4021
# 
# Apparently it hasn't been fixed yet. :)
# 
# Kind regards,
# Stefan.
# 
# At 23:12 18-3-2008, =?iso-8859-2?Q?Tom=E1=B9=20Kazmar?= wrote:
# >Hi all,
# >
# >   recently i tried to use second order b-splines to warp images and
# >the results contained sharp steps (~were not smooth). I am not sure
# >whether I do something wrong. Has anybody used it successfully?
# >
# >It seems to me that there is an error in
# >BSplineInterpolatingWeightFunction in combination with
# >BSplineKernelFunction. The first uses kernel in the range -1..2 and
# >the second defines the support as -1.5..1.5.
# >
# >Should I report it as a bug? There is a simple patch but once more
# >I am not sure whether I use it the right way.
# >
# >Here is the relevant part of code:
# >
# >   const unsigned int SplineOrder = 2;
# >   typedef itk::BSplineDeformableTransform<float, Dimension, SplineOrder> 
# > TransformType;
# >   TransformType::Pointer bsplineTransform = TransformType::New();
# >   typedef TransformType::RegionType RegionType;
# >   RegionType bsplineRegion;
# >   RegionType::SizeType size;
# >   const unsigned int nodesOutsideImage = SplineOrder;
# >   const unsigned int nodesInsideImage = 4;
# >   const unsigned int numberOfGridNodes = nodesInsideImage + 
# > nodesOutsideImage;
# >   size.Fill( numberOfGridNodes );
# >   bsplineRegion.SetSize( size );
# >   typedef TransformType::SpacingType SpacingType;
# >   SpacingType spacing;
# >   spacing[0] = 1.0 * floor( (width-1) / (double)(nodesInsideImage-1) );
# >   spacing[1] = 1.0 * floor( (height-1) / (double)(nodesInsideImage-1) );
# >   typedef TransformType::OriginType OriginType;
# >   OriginType origin;
# >   origin[0] = 0.0 - spacing[0];
# >   origin[1] = 0.0 - spacing[1];
# >   bsplineTransform->SetGridSpacing( spacing );
# >   bsplineTransform->SetGridOrigin( origin );
# >   bsplineTransform->SetGridRegion( bsplineRegion );
# >
# >
# >Regards,
# >Tomas
# >_______________________________________________
# >Insight-developers mailing list
# >Insight-developers at itk.org
# >http://www.itk.org/mailman/listinfo/insight-developers
# 
# 
# 
# 


More information about the Insight-developers mailing list