VTK  9.0.3
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:
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 
103  vtkMTimeType GetMTime() override;
104 
105 protected:
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 
144  void* GridPointer;
145  double GridSpacing[3];
146  double GridOrigin[3];
147  int GridExtent[6];
148  vtkIdType GridIncrements[3];
149 
150 private:
151  vtkBSplineTransform(const vtkBSplineTransform&) = delete;
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...
void ForwardTransformPoint(const float in[3], float out[3]) override
Internal functions for calculating the transformation.
virtual void SetCoefficientData(vtkImageData *)
void InternalUpdate() override
Update the displacement grid.
void InverseTransformPoint(const double in[3], double out[3]) override
vtkMTimeType GetMTime() override
Get the MTime.
void ForwardTransformPoint(const double in[3], double out[3]) override
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
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()
void InverseTransformDerivative(const double in[3], double out[3], double derivative[3][3]) override
const char * GetBorderModeAsString()
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:42
a simple class to control print indentation
Definition: vtkIndent.h:34
superclass for nonlinear geometric transformations
@ point
Definition: vtkX3D.h:242
#define VTK_BSPLINE_ZERO_AT_BORDER
#define VTK_BSPLINE_EDGE
#define VTK_BSPLINE_ZERO
int vtkIdType
Definition: vtkType.h:338
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:293