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 
44 class vtkAlgorithmOutput;
45 class vtkBSplineTransformConnectionHolder;
46 class vtkImageData;
47 
48 #define VTK_BSPLINE_EDGE 0
49 #define VTK_BSPLINE_ZERO 1
50 #define VTK_BSPLINE_ZERO_AT_BORDER 2
51 
52 class VTKFILTERSHYBRID_EXPORT vtkBSplineTransform : public vtkWarpTransform
53 {
54 public:
55  static vtkBSplineTransform* New();
57  void PrintSelf(ostream& os, vtkIndent indent) override;
58 
60 
66  virtual void SetCoefficientConnection(vtkAlgorithmOutput*);
67  virtual void SetCoefficientData(vtkImageData*);
68  virtual vtkImageData* GetCoefficientData();
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 
106  vtkMTimeType GetMTime() override;
107 
108 protected:
110  ~vtkBSplineTransform() override;
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 
147  void* GridPointer;
148  double GridSpacing[3];
149  double GridOrigin[3];
150  int GridExtent[6];
151  vtkIdType GridIncrements[3];
152 
153 private:
154  vtkBSplineTransform(const vtkBSplineTransform&) = delete;
155  void operator=(const vtkBSplineTransform&) = delete;
156 
157  vtkBSplineTransformConnectionHolder* ConnectionHolder;
158 };
159 
160 #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:287
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:332
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:39
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:53
#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