[Insight-developers] bug in BSplineDeformableTransform?
Luis Ibanez
luis.ibanez at kitware.com
Fri Mar 21 11:02:52 EDT 2008
Stehan, Tomas,
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.
A Fix has been committed to the CVS repository:
http://www.itk.org/cgi-bin/viewcvs.cgi/Code/Common/itkBSplineInterpolationWeightFunction.txx?root=Insight&r1=1.13&r2=1.14&sortby=date
Tests were added for 1D resampling using Spline orders 1,2 and 3:
http://www.itk.org/cgi-bin/viewcvs.cgi/Testing/Code/Common/itkBSplineDeformableTransformTest2.cxx?root=Insight&sortby=date&view=log
A test of kernel symmetry has been added:
http://www.itk.org/cgi-bin/viewcvs.cgi/Testing/Code/Common/itkBSplineInterpolationWeightFunctionTest.cxx?root=Insight&r1=1.4&r2=1.6&sortby=date
The bug 4021 has been marked as "resolved":
http://public.kitware.com/Bug/view.php?id=4021
Please give it a try and let us know if this works for you,
in which case we will proceed to close the bug.
Thanks
Luis
--------------------
Luis Ibanez wrote:
> Stefan, Tomas,
>
> Thanks for pointing this out and for proposing
> the fix.
>
> We will take care of it before cutting ITK 3.6.
>
>
> Thanks
>
>
> Luis
>
>
> ---------------------
> Tomáš Kazmar wrote:
>
>> 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
>> # # # # _______________________________________________
>> 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