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 =========================================================================*/
35 #ifndef vtkBSplineTransform_h
36 #define vtkBSplineTransform_h
37 
38 #include "vtkFiltersHybridModule.h" // For export macro
39 #include "vtkWarpTransform.h"
40 
41 class vtkAlgorithmOutput;
42 class vtkBSplineTransformConnectionHolder;
43 class vtkImageData;
44 
45 #define VTK_BSPLINE_EDGE 0
46 #define VTK_BSPLINE_ZERO 1
47 #define VTK_BSPLINE_ZERO_AT_BORDER 2
48 
49 class VTKFILTERSHYBRID_EXPORT vtkBSplineTransform : public vtkWarpTransform
50 {
51 public:
52  static vtkBSplineTransform *New();
54  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
55 
57 
63  virtual void SetCoefficientConnection(vtkAlgorithmOutput*);
64  virtual void SetCoefficientData(vtkImageData*);
65  virtual vtkImageData* GetCoefficientData();
67 
69 
72  vtkSetMacro(DisplacementScale, double);
73  vtkGetMacro(DisplacementScale, double);
75 
77 
87  vtkSetClampMacro(BorderMode, int,
90  this->SetBorderMode(VTK_BSPLINE_EDGE); }
92  this->SetBorderMode(VTK_BSPLINE_ZERO); }
94  this->SetBorderMode(VTK_BSPLINE_ZERO_AT_BORDER); }
95  vtkGetMacro(BorderMode, int);
96  const char *GetBorderModeAsString();
98 
102  vtkAbstractTransform *MakeTransform() VTK_OVERRIDE;
103 
107  vtkMTimeType GetMTime() VTK_OVERRIDE;
108 
109 protected:
111  ~vtkBSplineTransform() VTK_OVERRIDE;
112 
116  void InternalUpdate() VTK_OVERRIDE;
117 
121  void InternalDeepCopy(vtkAbstractTransform *transform) VTK_OVERRIDE;
122 
124 
127  void ForwardTransformPoint(const float in[3], float out[3]) VTK_OVERRIDE;
128  void ForwardTransformPoint(const double in[3], double out[3]) VTK_OVERRIDE;
130 
131  void ForwardTransformDerivative(const float in[3], float out[3],
132  float derivative[3][3]) VTK_OVERRIDE;
133  void ForwardTransformDerivative(const double in[3], double out[3],
134  double derivative[3][3]) VTK_OVERRIDE;
135 
136  void InverseTransformPoint(const float in[3], float out[3]) VTK_OVERRIDE;
137  void InverseTransformPoint(const double in[3], double out[3]) VTK_OVERRIDE;
138 
139  void InverseTransformDerivative(const float in[3], float out[3],
140  float derivative[3][3]) VTK_OVERRIDE;
141  void InverseTransformDerivative(const double in[3], double out[3],
142  double derivative[3][3]) VTK_OVERRIDE;
143 
144  void (*CalculateSpline)(const double point[3], double displacement[3],
145  double derivatives[3][3],
146  void *gridPtr, int inExt[6], vtkIdType inInc[3],
147  int borderMode);
148 
151 
152  void *GridPointer;
153  double GridSpacing[3];
154  double GridOrigin[3];
155  int GridExtent[6];
156  vtkIdType GridIncrements[3];
157 
158 private:
159  vtkBSplineTransform(const vtkBSplineTransform&) VTK_DELETE_FUNCTION;
160  void operator=(const vtkBSplineTransform&) VTK_DELETE_FUNCTION;
161 
162  vtkBSplineTransformConnectionHolder* ConnectionHolder;
163 };
164 
165 #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.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:300
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:345
virtual VTK_NEWINSTANCE vtkAbstractTransform * MakeTransform()=0
Make another transform of the same type.
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:33
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:39
#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