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 =========================================================================*/
38 #ifndef vtkBSplineTransform_h
39 #define vtkBSplineTransform_h
40 
41 #include "vtkFiltersHybridModule.h" // For export macro
42 #include "vtkWarpTransform.h"
43 
44 class vtkAlgorithmOutput;
45 class vtkBSplineTransformConnectionHolder;
46 class vtkImageData;
47 
48 #define VTK_BSPLINE_EDGE 0
49 #define VTK_BSPLINE_ZERO 1
50 #define VTK_BSPLINE_ZERO_AT_BORDER 2
51 
52 class VTKFILTERSHYBRID_EXPORT vtkBSplineTransform : public vtkWarpTransform
53 {
54 public:
55  static vtkBSplineTransform *New();
57  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
58 
60 
66  virtual void SetCoefficientConnection(vtkAlgorithmOutput*);
67  virtual void SetCoefficientData(vtkImageData*);
68  virtual vtkImageData* GetCoefficientData();
70 
72 
75  vtkSetMacro(DisplacementScale, double);
76  vtkGetMacro(DisplacementScale, double);
78 
80 
90  vtkSetClampMacro(BorderMode, int,
93  this->SetBorderMode(VTK_BSPLINE_EDGE); }
95  this->SetBorderMode(VTK_BSPLINE_ZERO); }
97  this->SetBorderMode(VTK_BSPLINE_ZERO_AT_BORDER); }
98  vtkGetMacro(BorderMode, int);
99  const char *GetBorderModeAsString();
101 
106 
111 
112 protected:
115 
119  void InternalUpdate();
120 
124  void InternalDeepCopy(vtkAbstractTransform *transform);
125 
127 
130  void ForwardTransformPoint(const float in[3], float out[3]);
131  void ForwardTransformPoint(const double in[3], double out[3]);
133 
134  void ForwardTransformDerivative(const float in[3], float out[3],
135  float derivative[3][3]);
136  void ForwardTransformDerivative(const double in[3], double out[3],
137  double derivative[3][3]);
138 
139  void InverseTransformPoint(const float in[3], float out[3]);
140  void InverseTransformPoint(const double in[3], double out[3]);
141 
142  void InverseTransformDerivative(const float in[3], float out[3],
143  float derivative[3][3]);
144  void InverseTransformDerivative(const double in[3], double out[3],
145  double derivative[3][3]);
146 
147  void (*CalculateSpline)(const double point[3], double displacement[3],
148  double derivatives[3][3],
149  void *gridPtr, int inExt[6], vtkIdType inInc[3],
150  int borderMode);
151 
154 
155  void *GridPointer;
156  double GridSpacing[3];
157  double GridOrigin[3];
158  int GridExtent[6];
159  vtkIdType GridIncrements[3];
160 
161 private:
162  vtkBSplineTransform(const vtkBSplineTransform&) VTK_DELETE_FUNCTION;
163  void operator=(const vtkBSplineTransform&) VTK_DELETE_FUNCTION;
164 
165  vtkBSplineTransformConnectionHolder* ConnectionHolder;
166 };
167 
168 #endif
#define VTK_BSPLINE_ZERO_AT_BORDER
virtual void ForwardTransformPoint(const float in[3], float out[3])=0
If the InverseFlag is set to 0, then a call to InternalTransformPoint results in a call to ForwardTra...
a cubic b-spline deformation transformation
virtual void InverseTransformPoint(const float in[3], float out[3])
If the InverseFlag is set to 1, then a call to InternalTransformPoint results in a call to InverseTra...
vtkMTimeType GetMTime() override
Override GetMTime necessary because of inverse transforms.
virtual void InverseTransformDerivative(const float in[3], float out[3], float derivative[3][3])
Calculate the inverse transform as well as the derivative of the forward transform (that's correct: t...
virtual void InternalUpdate()
Perform any subclass-specific Update.
int vtkIdType
Definition: vtkType.h:287
virtual VTK_NEWINSTANCE vtkAbstractTransform * MakeTransform()=0
Make another transform of the same type.
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248
Proxy object to connect input/output ports.
virtual void ForwardTransformDerivative(const float in[3], float out[3], float derivative[3][3])=0
Calculate the forward transform as well as the derivative.
virtual void InternalDeepCopy(vtkAbstractTransform *)
Perform any subclass-specific DeepCopy.
a simple class to control print indentation
Definition: vtkIndent.h:39
void SetBorderModeToZeroAtBorder()
Set/Get the border mode, to alter behavior at the edge of the grid.
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
#define VTK_BSPLINE_EDGE
superclass for all geometric transformations
superclass for nonlinear geometric transformations
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
void SetBorderModeToEdge()
Set/Get the border mode, to alter behavior at the edge of the grid.
void SetBorderModeToZero()
Set/Get the border mode, to alter behavior at the edge of the grid.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
#define VTK_BSPLINE_ZERO