[Insight-users] NonUniformBSpline - ITK Version 2.6.0.
Dan
drico at medipattern.com
Fri Nov 2 14:11:17 EDT 2007
Hi,
I'm having some difficulties understanding how the "NonUniformBSpline" ITK
method works.
The goal is to fit a second order spline through a set of 3 points as
follows:
const int nrPoints = 3;
const int splineOrder = 2;
typedef itk::NonUniformBSpline <2> splineTransformation;
splineTransformation::Pointer smartEditSplineTransf =
splineTransformation::New();
smartEditSplineTransf->SetSplineOrder(splineOrder);
//Set input points
splineTransformation::PointType refPoint ;
splineTransformation::PointListType pointList(nrPoints, refPoint);
pointList[0][0] = 212.0;//OX - point 1
pointList[0][1] = 116.0;//OY - point 1
pointList[1][0] = 69.0;//OX - point 2
pointList[1][1] = 221.0;//OY - point 2
pointList[2][0] = 132.0;//OX - point 3
pointList[2][1] = 88.0;//OY - point 3
//Set knot points
splineTransformation::KnotListType knotPointList;
knotPointList.push_back(212.0);//OX - point 1
knotPointList.push_back(69.0);//OX - point 2
knotPointList.push_back(132.0); //OX - point 3
smartEditSplineTransf->SetKnots(knotPointList);
smartEditSplineTransf->ComputeChordLengths();
In order to evaluate the spline on a number of points:
double nrPoints = 198.0;
splineTransformation::PointType pointOut;
for (i = 0; i < nrPoints; i++){
pointOut = smartEditSplineTransf->EvaluateSpline( ((double) i)/( nrPoints -
1.0) );
}
it seems to me that I also have to input a set of control points that I
don't understand what they stand for.
I've also tried to make use of the method:
smartEditSplineTransf->ComputeControlPoints();
but with no success.
Your feedback would be greatly appreciated
Thanks,
Dan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20071102/92bff931/attachment.htm
More information about the Insight-users
mailing list