VTK  9.3.20240327
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:
46  void PrintSelf(ostream& os, vtkIndent indent) override;
47 
49 
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:
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
superclass for all geometric transformations
Proxy object to connect input/output ports.
a cubic b-spline deformation transformation
void InverseTransformPoint(const float in[3], float out[3]) override
If the InverseFlag is set to 1, then a call to InternalTransformPoint results in a call to InverseTra...
void ForwardTransformPoint(const float in[3], float out[3]) override
Internal functions for calculating the transformation.
virtual void SetCoefficientData(vtkImageData *)
Set/Get the coefficient grid for the b-spline transform.
void InternalUpdate() override
Update the displacement grid.
void InverseTransformPoint(const double in[3], double out[3]) override
If the InverseFlag is set to 1, then a call to InternalTransformPoint results in a call to InverseTra...
vtkMTimeType GetMTime() override
Get the MTime.
void SetBorderModeToZero()
Set/Get the border mode, to alter behavior at the edge of the grid.
void ForwardTransformPoint(const double in[3], double out[3]) override
Internal functions for calculating the transformation.
vtkAbstractTransform * MakeTransform() override
Make another transform of the same type.
void InverseTransformDerivative(const float in[3], float out[3], float derivative[3][3]) override
Calculate the inverse transform as well as the derivative of the forward transform (that's correct: t...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void ForwardTransformDerivative(const double in[3], double out[3], double derivative[3][3]) override
Calculate the forward transform as well as the derivative.
void InternalDeepCopy(vtkAbstractTransform *transform) override
Copy this transform from another of the same type.
static vtkBSplineTransform * New()
void ForwardTransformDerivative(const float in[3], float out[3], float derivative[3][3]) override
Calculate the forward transform as well as the derivative.
virtual vtkImageData * GetCoefficientData()
Set/Get the coefficient grid for the b-spline transform.
void SetBorderModeToZeroAtBorder()
Set/Get the border mode, to alter behavior at the edge of the grid.
void InverseTransformDerivative(const double in[3], double out[3], double derivative[3][3]) override
Calculate the inverse transform as well as the derivative of the forward transform (that's correct: t...
const char * GetBorderModeAsString()
Set/Get the border mode, to alter behavior at the edge of the grid.
void SetBorderModeToEdge()
Set/Get the border mode, to alter behavior at the edge of the grid.
virtual void SetCoefficientConnection(vtkAlgorithmOutput *)
Set/Get the coefficient grid for the b-spline transform.
~vtkBSplineTransform() override
topologically and geometrically regular array of data
Definition: vtkImageData.h:155
a simple class to control print indentation
Definition: vtkIndent.h:108
superclass for nonlinear geometric transformations
@ point
Definition: vtkX3D.h:236
#define VTK_BSPLINE_ZERO_AT_BORDER
#define VTK_BSPLINE_EDGE
#define VTK_BSPLINE_ZERO
int vtkIdType
Definition: vtkType.h:315
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270