VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 "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 
51 class VTKFILTERSHYBRID_EXPORT vtkBSplineTransform : public vtkWarpTransform
52 {
53 public:
54  static vtkBSplineTransform *New();
55  vtkTypeMacro(vtkBSplineTransform,vtkWarpTransform);
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);
72 
74 
82  vtkSetClampMacro(BorderMode, int,
85  this->SetBorderMode(VTK_BSPLINE_EDGE); }
87  this->SetBorderMode(VTK_BSPLINE_ZERO); }
89  this->SetBorderMode(VTK_BSPLINE_ZERO_AT_BORDER); }
90  vtkGetMacro(BorderMode, int);
91  const char *GetBorderModeAsString();
93 
95  vtkAbstractTransform *MakeTransform();
96 
98  unsigned long GetMTime();
99 
100 protected:
103 
105  void InternalUpdate();
106 
108  void InternalDeepCopy(vtkAbstractTransform *transform);
109 
111 
112  void ForwardTransformPoint(const float in[3], float out[3]);
113  void ForwardTransformPoint(const double in[3], double out[3]);
115 
116  void ForwardTransformDerivative(const float in[3], float out[3],
117  float derivative[3][3]);
118  void ForwardTransformDerivative(const double in[3], double out[3],
119  double derivative[3][3]);
120 
121  void InverseTransformPoint(const float in[3], float out[3]);
122  void InverseTransformPoint(const double in[3], double out[3]);
123 
124  void InverseTransformDerivative(const float in[3], float out[3],
125  float derivative[3][3]);
126  void InverseTransformDerivative(const double in[3], double out[3],
127  double derivative[3][3]);
128 
129 //BTX
130  void (*CalculateSpline)(const double point[3], double displacement[3],
131  double derivatives[3][3],
132  void *gridPtr, int inExt[6], vtkIdType inInc[3],
133  int borderMode);
134 //ETX
135 
138 
139  void *GridPointer;
140  double GridSpacing[3];
141  double GridOrigin[3];
142  int GridExtent[6];
143  vtkIdType GridIncrements[3];
144 
145 private:
146  vtkBSplineTransform(const vtkBSplineTransform&); // Not implemented.
147  void operator=(const vtkBSplineTransform&); // Not implemented.
148 
149  vtkBSplineTransformConnectionHolder* ConnectionHolder;
150 };
151 
152 #endif
#define VTK_BSPLINE_ZERO_AT_BORDER
a cubic b-spline deformation transformation
#define VTK_BSPLINE_EDGE
#define VTK_BSPLINE_ZERO