Slicer  4.8
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkAddonMathUtilities.h
Go to the documentation of this file.
1 /*=auto==============================================================================
2 
3  Program: 3D Slicer
4 
5  See COPYRIGHT.txt
6  or http://www.slicer.org/copyright/copyright.txt for details.
7 
8  Unless required by applicable law or agreed to in writing, software
9  distributed under the License is distributed on an "AS IS" BASIS,
10  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11  See the License for the specific language governing permissions and
12  limitations under the License.
13 
14 ===============================================================================auto=*/
15 
19 
20 #ifndef __vtkAddonMathUtilities_h
21 #define __vtkAddonMathUtilities_h
22 
23 #include <vtkAddon.h>
24 #include <vtkObject.h>
25 
26 class vtkMatrix4x4;
27 class vtkMatrix3x3;
28 
29 class VTK_ADDON_EXPORT vtkAddonMathUtilities : public vtkObject
30 {
31 public:
32  static vtkAddonMathUtilities *New();
33  vtkTypeMacro(vtkAddonMathUtilities,vtkObject);
34  virtual void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
35 
36  static bool MatrixAreEqual(const vtkMatrix4x4* m1,
37  const vtkMatrix4x4* m2,
38  double tolerance = 1e-3);
39 
40  static bool MatrixAreEqual(const vtkMatrix4x4 *m1,
41  const vtkMatrix3x3 *m2,
42  double tolerance = 1e-3);
43 
44  static bool MatrixAreEqual(const vtkMatrix3x3 *m1,
45  const vtkMatrix4x4 *m2,
46  double tolerance = 1e-3);
47 
48  static bool MatrixAreEqual(const vtkMatrix3x3 *m1,
49  const vtkMatrix3x3 *m2,
50  double tolerance = 1e-3);
51 
54  static void GetOrientationMatrix(vtkMatrix4x4* source, vtkMatrix3x3* dest);
55 
58  static void SetOrientationMatrix(vtkMatrix3x3* source, vtkMatrix4x4* dest);
59 
61  static void NormalizeColumns(vtkMatrix3x3 *m, double scale[3]);
62 
64  static void NormalizeOrientationMatrixColumns(vtkMatrix4x4 *m, double scale[3]);
65 
67  static std::string ToString(const vtkMatrix4x4* mat, const std::string delimiter = " ", const std::string rowDelimiter = "");
68 
70  static bool FromString(vtkMatrix4x4* mat, const std::string& str, const std::string delimiterExp = "(\\ |\\,|\\:|\\;|\t|\n|\\[|\\])");
71 
72 protected:
75 
76 private:
77  vtkAddonMathUtilities(const vtkAddonMathUtilities&); // Not implemented.
78  void operator=(const vtkAddonMathUtilities&); // Not implemented.
79 };
80 
81 #endif
std::string ToString(Type value)