VTK  9.1.0
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
42class vtkBSplineTransformConnectionHolder;
43class vtkImageData;
44
45#define VTK_BSPLINE_EDGE 0
46#define VTK_BSPLINE_ZERO 1
47#define VTK_BSPLINE_ZERO_AT_BORDER 2
48
49class VTKFILTERSHYBRID_EXPORT vtkBSplineTransform : public vtkWarpTransform
50{
51public:
54 void PrintSelf(ostream& os, vtkIndent indent) override;
55
57
67
69
72 vtkSetMacro(DisplacementScale, double);
73 vtkGetMacro(DisplacementScale, double);
75
77
87 vtkSetClampMacro(BorderMode, int, VTK_BSPLINE_EDGE, VTK_BSPLINE_ZERO_AT_BORDER);
88 void SetBorderModeToEdge() { this->SetBorderMode(VTK_BSPLINE_EDGE); }
89 void SetBorderModeToZero() { this->SetBorderMode(VTK_BSPLINE_ZERO); }
91 vtkGetMacro(BorderMode, int);
92 const char* GetBorderModeAsString();
94
99
104
105protected:
108
112 void InternalUpdate() override;
113
117 void InternalDeepCopy(vtkAbstractTransform* transform) override;
118
120
123 void ForwardTransformPoint(const float in[3], float out[3]) override;
124 void ForwardTransformPoint(const double in[3], double out[3]) override;
126
127 void ForwardTransformDerivative(const float in[3], float out[3], float derivative[3][3]) override;
129 const double in[3], double out[3], double derivative[3][3]) override;
130
131 void InverseTransformPoint(const float in[3], float out[3]) override;
132 void InverseTransformPoint(const double in[3], double out[3]) override;
133
134 void InverseTransformDerivative(const float in[3], float out[3], float derivative[3][3]) override;
136 const double in[3], double out[3], double derivative[3][3]) override;
137
138 void (*CalculateSpline)(const double point[3], double displacement[3], double derivatives[3][3],
139 void* gridPtr, int inExt[6], vtkIdType inInc[3], int borderMode);
140
143
145 double GridSpacing[3];
146 double GridOrigin[3];
147 int GridExtent[6];
148 vtkIdType GridIncrements[3];
149
150private:
152 void operator=(const vtkBSplineTransform&) = delete;
153
154 vtkBSplineTransformConnectionHolder* ConnectionHolder;
155};
156
157#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:157
a simple class to control print indentation
Definition: vtkIndent.h:113
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