VTK  9.2.6
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
45class vtkBSplineTransformConnectionHolder;
46class vtkImageData;
47
48#define VTK_BSPLINE_EDGE 0
49#define VTK_BSPLINE_ZERO 1
50#define VTK_BSPLINE_ZERO_AT_BORDER 2
51
52class VTKFILTERSHYBRID_EXPORT vtkBSplineTransform : public vtkWarpTransform
53{
54public:
57 void PrintSelf(ostream& os, vtkIndent indent) override;
58
60
70
72
75 vtkSetMacro(DisplacementScale, double);
76 vtkGetMacro(DisplacementScale, double);
78
80
90 vtkSetClampMacro(BorderMode, int, VTK_BSPLINE_EDGE, VTK_BSPLINE_ZERO_AT_BORDER);
91 void SetBorderModeToEdge() { this->SetBorderMode(VTK_BSPLINE_EDGE); }
92 void SetBorderModeToZero() { this->SetBorderMode(VTK_BSPLINE_ZERO); }
94 vtkGetMacro(BorderMode, int);
95 const char* GetBorderModeAsString();
97
102
107
108protected:
111
115 void InternalUpdate() override;
116
120 void InternalDeepCopy(vtkAbstractTransform* transform) override;
121
123
126 void ForwardTransformPoint(const float in[3], float out[3]) override;
127 void ForwardTransformPoint(const double in[3], double out[3]) override;
129
130 void ForwardTransformDerivative(const float in[3], float out[3], float derivative[3][3]) override;
132 const double in[3], double out[3], double derivative[3][3]) override;
133
134 void InverseTransformPoint(const float in[3], float out[3]) override;
135 void InverseTransformPoint(const double in[3], double out[3]) override;
136
137 void InverseTransformDerivative(const float in[3], float out[3], float derivative[3][3]) override;
139 const double in[3], double out[3], double derivative[3][3]) override;
140
141 void (*CalculateSpline)(const double point[3], double displacement[3], double derivatives[3][3],
142 void* gridPtr, int inExt[6], vtkIdType inInc[3], int borderMode);
143
146
148 double GridSpacing[3];
149 double GridOrigin[3];
150 int GridExtent[6];
151 vtkIdType GridIncrements[3];
152
153private:
155 void operator=(const vtkBSplineTransform&) = delete;
156
157 vtkBSplineTransformConnectionHolder* ConnectionHolder;
158};
159
160#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...
const char * GetBorderModeAsString()
Set/Get the border mode, to alter behavior at the edge of the grid.
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...
static vtkBSplineTransform * New()
vtkMTimeType GetMTime() override
Get the MTime.
vtkAbstractTransform * MakeTransform() override
Make another transform of the same type.
void SetBorderModeToZero()
Set/Get the border mode, to alter behavior at the edge of the grid.
virtual vtkImageData * GetCoefficientData()
Set/Get the coefficient grid for the b-spline transform.
void ForwardTransformPoint(const double in[3], double out[3]) override
Internal functions for calculating the transformation.
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.
void ForwardTransformDerivative(const float in[3], float out[3], float derivative[3][3]) override
Calculate the forward transform as well as the derivative.
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...
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:54
a simple class to control print indentation
Definition: vtkIndent.h:40
superclass for nonlinear geometric transformations
#define VTK_BSPLINE_ZERO_AT_BORDER
#define VTK_BSPLINE_EDGE
#define VTK_BSPLINE_ZERO
int vtkIdType
Definition: vtkType.h:332
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287