30 #ifndef vtkParametricPolynomialApproximation_h 31 #define vtkParametricPolynomialApproximation_h 37 #include "vtkSlicerMarkupsModuleMRMLExport.h" 39 #include <vtkParametricFunction.h> 40 #include <vtkSmartPointer.h> 46 void PrintSelf(ostream& os, vtkIndent indent)
override;
59 void Evaluate(
double u[3],
double Pt[3],
double Du[9])
override;
65 double EvaluateScalar(
double u[3],
double Pt[3],
double Du[9])
override;
71 vtkGetMacro(PolynomialOrder,
int);
72 vtkSetMacro(PolynomialOrder,
int);
80 void SetPoints(vtkPoints*);
88 void SetParameters(vtkDoubleArray*);
96 FIT_METHOD_GLOBAL_LEAST_SQUARES = 0,
106 vtkGetMacro(FitMethod,
int);
107 vtkSetMacro(FitMethod,
int);
117 WEIGHT_FUNCTION_RECTANGULAR = 0,
129 vtkGetMacro(WeightFunction,
int);
130 vtkSetMacro(WeightFunction,
int);
145 vtkGetMacro(SampleWidth,
double);
146 vtkSetMacro(SampleWidth,
double);
159 vtkSmartPointer< vtkDoubleArray > Parameters;
160 vtkSmartPointer< vtkPoints > Points;
161 double SamplePosition;
164 vtkSmartPointer< vtkDoubleArray > Weights;
165 vtkSmartPointer< vtkDoubleArray > SortedParameters;
168 double SafeSampleWidth;
169 vtkTimeStamp SafeHalfSampleWidthComputedTime;
172 vtkSmartPointer< vtkDoubleArray > Coefficients;
175 void ComputeCoefficients();
176 bool ComputeCoefficientsNeeded();
177 void ComputeWeights();
178 void ComputeWeightsGlobalLeastSquares();
179 void ComputeWeightsMovingLeastSquares();
180 bool ComputeWeightsNeeded();
181 void ComputeSortedParameters();
182 bool ComputeSortedParametersNeeded();
183 void ComputeSafeSampleWidth();
184 bool ComputeSafeSampleWidthNeeded();
185 static void FitLeastSquaresPolynomials(vtkDoubleArray* parameters, vtkPoints* points,
186 vtkDoubleArray* weights,
int polynomialOrder, vtkDoubleArray* coefficients);
void SetWeightFunctionToGaussian()
void SetWeightFunctionToTriangular()
void SetFitMethodToGlobalLeastSquares()
void SetWeightFunctionToCosine()
parametric function for 1D polynomials
int GetDimension() override
void SetFitMethodToMovingLeastSquares()
void SetWeightFunctionToRectangular()