vtkBSplineInterpolateImageFunction.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00020
00021
00022 #ifndef __vtkBSplineInterpolateImageFunction_h
00023 #define __vtkBSplineInterpolateImageFunction_h
00024
00025 #include "vtkImplicitFunction.h"
00026 #include "vtkTeemConfigure.h"
00027
00028 #include <vtkstd/vector>
00029
00030 #define VTK_INTEGRATE_MAJOR_EIGENVECTOR 0
00031 #define VTK_INTEGRATE_MEDIUM_EIGENVECTOR 1
00032 #define VTK_INTEGRATE_MINOR_EIGENVECTOR 2
00033
00034 #define ImageDimension 3
00035
00036 class vtkImageData;
00037 class VTK_Teem_EXPORT vtkBSplineInterpolateImageFunction : public vtkImplicitFunction
00038 {
00039 public:
00040 static vtkBSplineInterpolateImageFunction *New();
00041 vtkTypeRevisionMacro(vtkBSplineInterpolateImageFunction, vtkImplicitFunction );
00042 virtual void PrintSelf(ostream& os, vtkIndent indent);
00043
00044 virtual vtkFloatingPointType EvaluateFunction (vtkFloatingPointType x[ImageDimension]);
00045
00046 virtual void EvaluateGradient (vtkFloatingPointType x[ImageDimension],
00047 vtkFloatingPointType g[ImageDimension]);
00048 void SetInput(vtkImageData* dataset);
00049
00050 unsigned int GetSplineOrder() { return this->SplineOrder; }
00051 void SetSplineOrder(unsigned int order);
00052
00053 protected:
00054 vtkBSplineInterpolateImageFunction() {
00055 this->Initialized = 0;
00056 this->SplineOrder = 0;
00057 this->SetSplineOrder(3);
00058 }
00059 ~vtkBSplineInterpolateImageFunction() {}
00060 int DataLength[ImageDimension];
00061 unsigned int SplineOrder;
00062
00063 vtkImageData * Coefficients;
00064 vtkFloatingPointType * Origin;
00065 vtkFloatingPointType * Spacing;
00066 int * Extent;
00067 private:
00068
00069 int Initialized;
00070 vtkBSplineInterpolateImageFunction(const vtkBSplineInterpolateImageFunction&);
00071 void operator=(const vtkBSplineInterpolateImageFunction&);
00072
00074 void SetInterpolationWeights( vtkFloatingPointType *x, long *evaluateIndex[ImageDimension],
00075 double *weights[ImageDimension],unsigned int splineOrder ) const;
00076
00078 void SetDerivativeWeights( vtkFloatingPointType *x, long *evaluateIndex[ImageDimension],
00079 double *weights[ImageDimension], unsigned int splineOrder ) const;
00080
00083 void GeneratePointsToIndex();
00084
00086 void DetermineRegionOfSupport( long *evaluateIndex[ImageDimension],
00087 vtkFloatingPointType x[], unsigned int splineOrder ) const;
00088
00091 void ApplyMirrorBoundaryConditions(long *evaluateIndex[ImageDimension],
00092 unsigned int splineOrder) const;
00093
00094
00095 unsigned int MaxNumberInterpolationPoints;
00096 std::vector<int> PointsToIndex[ImageDimension];
00097
00098 };
00099
00100
00101 #endif