int
main()
{
constexpr unsigned int ParametricDimension = 1;
constexpr unsigned int DataDimension = 2;
param0[0] = 0.0;
DataType p0;
p0[0] = 10.0;
p0[1] = 10.0;
pointSet->SetPoint(0, param0);
pointSet->SetPointData(0, p0);
param1[0] = 1.0;
DataType p1;
p1[0] = 80.0;
p1[1] = 50.0;
pointSet->SetPoint(1, param1);
pointSet->SetPointData(1, p1);
param2[0] = 2.0;
DataType p2;
p2[0] = 180.0;
p2[1] = 180.0;
pointSet->SetPoint(2, param2);
pointSet->SetPointData(2, p2);
int splineorder = 2;
SplineFilterType::ArrayType ncontrol;
ncontrol[0] = splineorder + 1;
SplineFilterType::ArrayType closedim;
closedim[0] = 0;
parametricDomainOrigin[0] = 0.0;
ImageType::SpacingType parametricDomainSpacing;
parametricDomainSpacing[0] = 0.0001;
parametricDomainSize[0] = 2.0 / parametricDomainSpacing[0] + 1;
splineFilter->SetGenerateOutputImage(true);
splineFilter->SetInput(pointSet);
splineFilter->SetSplineOrder(splineorder);
splineFilter->SetNumberOfControlPoints(ncontrol);
splineFilter->SetNumberOfLevels(3);
splineFilter->SetCloseDimension(closedim);
splineFilter->
SetSize(parametricDomainSize);
splineFilter->SetSpacing(parametricDomainSpacing);
splineFilter->SetOrigin(parametricDomainOrigin);
splineFilter->Update();
outputImage->SetRegions(region);
outputImage->Allocate();
outputImage->FillBuffer(0);
for (unsigned int i = 0; i < splineFilter->GetOutput()->GetLargestPossibleRegion().GetSize()[0]; ++i)
{
splineIndex[0] = i;
DataType outputPixel = splineFilter->GetOutput()->GetPixel(splineIndex);
index[0] = outputPixel[0];
index[1] = outputPixel[1];
outputImage->SetPixel(index, 255);
}
return EXIT_SUCCESS;
};