VTK  9.3.1
vtkBSplineTransform.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
26 #ifndef vtkBSplineTransform_h
27 #define vtkBSplineTransform_h
28 
29 #include "vtkFiltersHybridModule.h" // For export macro
30 #include "vtkWarpTransform.h"
31 
32 VTK_ABI_NAMESPACE_BEGIN
33 class vtkAlgorithmOutput;
34 class vtkBSplineTransformConnectionHolder;
35 class vtkImageData;
36 
37 #define VTK_BSPLINE_EDGE 0
38 #define VTK_BSPLINE_ZERO 1
39 #define VTK_BSPLINE_ZERO_AT_BORDER 2
40 
41 class VTKFILTERSHYBRID_EXPORT vtkBSplineTransform : public vtkWarpTransform
42 {
43 public:
44  static vtkBSplineTransform* New();
46  void PrintSelf(ostream& os, vtkIndent indent) override;
47 
49 
55  virtual void SetCoefficientConnection(vtkAlgorithmOutput*);
56  virtual void SetCoefficientData(vtkImageData*);
57  virtual vtkImageData* GetCoefficientData();
59 
61 
64  vtkSetMacro(DisplacementScale, double);
65  vtkGetMacro(DisplacementScale, double);
67 
69 
79  vtkSetClampMacro(BorderMode, int, VTK_BSPLINE_EDGE, VTK_BSPLINE_ZERO_AT_BORDER);
80  void SetBorderModeToEdge() { this->SetBorderMode(VTK_BSPLINE_EDGE); }
81  void SetBorderModeToZero() { this->SetBorderMode(VTK_BSPLINE_ZERO); }
83  vtkGetMacro(BorderMode, int);
84  const char* GetBorderModeAsString();
86 
91 
95  vtkMTimeType GetMTime() override;
96 
97 protected:
99  ~vtkBSplineTransform() override;
100 
104  void InternalUpdate() override;
105 
109  void InternalDeepCopy(vtkAbstractTransform* transform) override;
110 
112 
115  void ForwardTransformPoint(const float in[3], float out[3]) override;
116  void ForwardTransformPoint(const double in[3], double out[3]) override;
118 
119  void ForwardTransformDerivative(const float in[3], float out[3], float derivative[3][3]) override;
121  const double in[3], double out[3], double derivative[3][3]) override;
122 
123  void InverseTransformPoint(const float in[3], float out[3]) override;
124  void InverseTransformPoint(const double in[3], double out[3]) override;
125 
126  void InverseTransformDerivative(const float in[3], float out[3], float derivative[3][3]) override;
128  const double in[3], double out[3], double derivative[3][3]) override;
129 
130  void (*CalculateSpline)(const double point[3], double displacement[3], double derivatives[3][3],
131  void* gridPtr, int inExt[6], vtkIdType inInc[3], int borderMode);
132 
135 
136  void* GridPointer;
137  double GridSpacing[3];
138  double GridOrigin[3];
139  int GridExtent[6];
140  vtkIdType GridIncrements[3];
141 
142 private:
143  vtkBSplineTransform(const vtkBSplineTransform&) = delete;
144  void operator=(const vtkBSplineTransform&) = delete;
145 
146  vtkBSplineTransformConnectionHolder* ConnectionHolder;
147 };
148 
149 VTK_ABI_NAMESPACE_END
150 #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:270
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.
virtual vtkAbstractTransform * MakeTransform()=0
Make another transform of the same type.
int vtkIdType
Definition: vtkType.h:315
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:28
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:42
#define VTK_BSPLINE_EDGE
superclass for all geometric transformations
superclass for nonlinear geometric transformations
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