Slicer  4.11
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkOrientedGridTransform.h
Go to the documentation of this file.
1 /*=auto=========================================================================
2 
3  Portions (c) Copyright 2005 Brigham and Women's Hospital (BWH) All Rights Reserved.
4 
5  See COPYRIGHT.txt
6  or http://www.slicer.org/copyright/copyright.txt for details.
7 
8 =========================================================================auto=*/
9 
15 
16 #ifndef __vtkOrientedGridTransform_h
17 #define __vtkOrientedGridTransform_h
18 
19 #include "vtkAddon.h"
20 
21 #include "vtkCommand.h"
22 #include "vtkGridTransform.h"
23 
24 class VTK_ADDON_EXPORT vtkOrientedGridTransform : public vtkGridTransform
25 {
26 public:
27  static vtkOrientedGridTransform *New();
28  vtkTypeMacro(vtkOrientedGridTransform,vtkGridTransform);
29  void PrintSelf(ostream& os, vtkIndent indent) override;
30 
31  // Description:
32  // Set/Get the b-spline grid axis directions.
33  // This transform class will never modify the data.
34  // Must be an orthogonal, normalized matrix.
35  // The 4th column and 4th row are ignored.
36  virtual void SetGridDirectionMatrix(vtkMatrix4x4*);
37  vtkGetObjectMacro(GridDirectionMatrix,vtkMatrix4x4);
38 
39  // Description:
40  // Make another transform of the same type.
41  vtkAbstractTransform *MakeTransform() override;
42 
44  // ConvergenceFailureEvent is invoked when the gradient cannot be
45  // inverted, probably due to a singular transform or numeric instability.
46  enum Events
47  {
48  ConvergenceFailureEvent = vtkCommand::UserEvent + 1
49  };
50 
51 protected:
53  ~vtkOrientedGridTransform() override;
54 
55  // Description:
56  // Update the displacement grid.
57  void InternalUpdate() override;
58 
59  // Description:
60  // Copy this transform from another of the same type.
61  void InternalDeepCopy(vtkAbstractTransform *transform) override;
62 
63  // Avoid hiding overloads from base class... these will include the float
64  // overloads that forward to the double overloads (hence no need to override
65  // the float versions)
66  using vtkGridTransform::ForwardTransformPoint;
67  using vtkGridTransform::ForwardTransformDerivative;
68  using vtkGridTransform::InverseTransformDerivative;
69 
70  // Description:
71  // Internal functions for calculating the transformation.
72  void ForwardTransformPoint(const double in[3], double out[3]) override;
73 
74  void ForwardTransformDerivative(const double in[3], double out[3],
75  double derivative[3][3]) override;
76 
77  void InverseTransformDerivative(const double in[3], double out[3],
78  double derivative[3][3]) override;
79 
80  // Description:
81  // Grid axis direction vectors (i, j, k) in the output space
82  vtkMatrix4x4* GridDirectionMatrix;
83 
84  // Description:
85  // Transforms a point from the output coordinate system to the
86  // grid index (IJK) coordinate system.
89 
90  // Description:
91  // Avoid generating hundreds of warning messages for convergence problems
92  // by keeping track of the MTime when the last warning was issued.
93  vtkMTimeType LastWarningMTime;
94 
95 private:
97  void operator=(const vtkOrientedGridTransform&) = delete;
98 };
99 
100 #endif
vtkMatrix4x4 * OutputToGridIndexTransformMatrixCached
vtkOrientedGridTransform - arbitrarily oriented displacement field deformation transformation.
vtkMatrix4x4 * GridIndexToOutputTransformMatrixCached
Events
List of custom events fired by the class.