VTK
vtkBSplineTransform.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkBSplineTransform.h
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 "vtkFiltersHybridModule.h" // For export macro
41 #include "vtkWarpTransform.h"
42 
43 class vtkAlgorithmOutput;
44 class vtkBSplineTransformConnectionHolder;
45 class vtkImageData;
46 
47 #define VTK_BSPLINE_EDGE 0
48 #define VTK_BSPLINE_ZERO 1
49 #define VTK_BSPLINE_ZERO_AT_BORDER 2
50 
52 {
53 public:
54  static vtkBSplineTransform *New();
56  virtual void PrintSelf(ostream& os, vtkIndent indent);
57 
59 
63  virtual void SetCoefficientConnection(vtkAlgorithmOutput*);
64  virtual void SetCoefficientData(vtkImageData*);
65  virtual vtkImageData* GetCoefficientData();
67 
69 
70  vtkSetMacro(DisplacementScale, double);
71  vtkGetMacro(DisplacementScale, double);
73 
75 
83  vtkSetClampMacro(BorderMode, int,
86  this->SetBorderMode(VTK_BSPLINE_EDGE); }
88  this->SetBorderMode(VTK_BSPLINE_ZERO); }
90  this->SetBorderMode(VTK_BSPLINE_ZERO_AT_BORDER); }
91  vtkGetMacro(BorderMode, int);
92  const char *GetBorderModeAsString();
94 
97 
99  unsigned long GetMTime();
100 
101 protected:
104 
106  void InternalUpdate();
107 
109  void InternalDeepCopy(vtkAbstractTransform *transform);
110 
112 
113  void ForwardTransformPoint(const float in[3], float out[3]);
114  void ForwardTransformPoint(const double in[3], double out[3]);
116 
117  void ForwardTransformDerivative(const float in[3], float out[3],
118  float derivative[3][3]);
119  void ForwardTransformDerivative(const double in[3], double out[3],
120  double derivative[3][3]);
121 
122  void InverseTransformPoint(const float in[3], float out[3]);
123  void InverseTransformPoint(const double in[3], double out[3]);
124 
125  void InverseTransformDerivative(const float in[3], float out[3],
126  float derivative[3][3]);
127  void InverseTransformDerivative(const double in[3], double out[3],
128  double derivative[3][3]);
129 
130 //BTX
131  void (*CalculateSpline)(const double point[3], double displacement[3],
132  double derivatives[3][3],
133  void *gridPtr, int inExt[6], vtkIdType inInc[3],
134  int borderMode);
135 //ETX
136 
139 
140  void *GridPointer;
141  double GridSpacing[3];
142  double GridOrigin[3];
143  int GridExtent[6];
144  vtkIdType GridIncrements[3];
145 
146 private:
147  vtkBSplineTransform(const vtkBSplineTransform&); // Not implemented.
148  void operator=(const vtkBSplineTransform&); // Not implemented.
149 
150  vtkBSplineTransformConnectionHolder* ConnectionHolder;
151 };
152 
153 #endif
#define VTK_BSPLINE_ZERO_AT_BORDER
virtual void ForwardTransformPoint(const float in[3], float out[3])=0
a cubic b-spline deformation transformation
virtual void InverseTransformPoint(const float in[3], float out[3])
void PrintSelf(ostream &os, vtkIndent indent)
unsigned long GetMTime()
virtual void InverseTransformDerivative(const float in[3], float out[3], float derivative[3][3])
virtual vtkAbstractTransform * MakeTransform()=0
int vtkIdType
Definition: vtkType.h:247
Proxy object to connect input/output ports.
virtual void ForwardTransformDerivative(const float in[3], float out[3], float derivative[3][3])=0
virtual void InternalDeepCopy(vtkAbstractTransform *)
a simple class to control print indentation
Definition: vtkIndent.h:38
#define VTKFILTERSHYBRID_EXPORT
topologically and geometrically regular array of data
Definition: vtkImageData.h:44
#define VTK_BSPLINE_EDGE
superclass for all geometric transformations
superclass for nonlinear geometric transformations
static vtkObject * New()
#define VTK_BSPLINE_ZERO