VTK
vtkBSplineTransform.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: $RCSfile: vtkBSplineTransform.h,v $
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
37 #ifndef __vtkBSplineTransform_h
38 #define __vtkBSplineTransform_h
39 
40 #include "vtkWarpTransform.h"
41 
42 class vtkImageData;
43 
44 #define VTK_BSPLINE_EDGE 0
45 #define VTK_BSPLINE_ZERO 1
46 #define VTK_BSPLINE_ZERO_AT_BORDER 2
47 
49 {
50 public:
51  static vtkBSplineTransform *New();
53  virtual void PrintSelf(ostream& os, vtkIndent indent);
54 
56 
58  virtual void SetCoefficients(vtkImageData*);
59  vtkGetObjectMacro(Coefficients,vtkImageData);
61 
63 
64  vtkSetMacro(DisplacementScale,double);
66 
68 
76  vtkSetClampMacro(BorderMode, int,
79  this->SetBorderMode(VTK_BSPLINE_EDGE); }
81  this->SetBorderMode(VTK_BSPLINE_ZERO); }
83  this->SetBorderMode(VTK_BSPLINE_ZERO_AT_BORDER); }
84  vtkGetMacro(BorderMode, int);
85  const char *GetBorderModeAsString();
87 
90 
92  unsigned long GetMTime();
93 
94 protected:
97 
99  void InternalUpdate();
100 
102  void InternalDeepCopy(vtkAbstractTransform *transform);
103 
105 
106  void ForwardTransformPoint(const float in[3], float out[3]);
107  void ForwardTransformPoint(const double in[3], double out[3]);
109 
110  void ForwardTransformDerivative(const float in[3], float out[3],
111  float derivative[3][3]);
112  void ForwardTransformDerivative(const double in[3], double out[3],
113  double derivative[3][3]);
114 
115  void InverseTransformPoint(const float in[3], float out[3]);
116  void InverseTransformPoint(const double in[3], double out[3]);
117 
118  void InverseTransformDerivative(const float in[3], float out[3],
119  float derivative[3][3]);
120  void InverseTransformDerivative(const double in[3], double out[3],
121  double derivative[3][3]);
122 
123 //BTX
124  void (*CalculateSpline)(const double point[3], double displacement[3],
125  double derivatives[3][3],
126  void *gridPtr, int inExt[6], vtkIdType inInc[3],
127  int borderMode);
128 //ETX
129 
133 
134  void *GridPointer;
135  double GridSpacing[3];
136  double GridOrigin[3];
137  int GridExtent[6];
138  vtkIdType GridIncrements[3];
139 
140 private:
141  vtkBSplineTransform(const vtkBSplineTransform&); // Not implemented.
142  void operator=(const vtkBSplineTransform&); // Not implemented.
143 };
144 
145 #endif