GDCM 3.0.24
gdcmDirectionCosines.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: GDCM (Grassroots DICOM). A DICOM library
4
5 Copyright (c) 2006-2011 Mathieu Malaterre
6 All rights reserved.
7 See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
8
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the above copyright notice for more information.
12
13=========================================================================*/
14#ifndef GDCMDIRECTIONCOSINES_H
15#define GDCMDIRECTIONCOSINES_H
16
17#include "gdcmTypes.h"
18
19namespace gdcm
20{
21
26{
27public:
29 DirectionCosines(const double dircos[6]);
30 // Cannot get the following signature to be wrapped with swig...
31 //DirectionCosines(const double *dircos = 0 );
33
35 void Print(std::ostream &) const;
36
38 void Cross(double z[3]) const;
39
41 double Dot() const;
42
44 static double Dot(const double x[3], const double y[3]);
45
47 void Normalize();
48
50 static void Normalize(double v[3]);
51
53 static double Norm(const double v[3]);
54
56 operator const double* () const { return Values; }
57
59 bool IsValid() const;
60
63 bool SetFromString(const char *str);
64
66 double CrossDot(DirectionCosines const &dc) const;
67
69 double ComputeDistAlongNormal(const double ipp[3]) const;
70
71private:
72 double Values[6];
73};
74
75} // end namespace gdcm
76
77#endif //GDCMDIRECTIONCOSINES_H
class to handle DirectionCosines
Definition gdcmDirectionCosines.h:26
double ComputeDistAlongNormal(const double ipp[3]) const
Compute the distance along the normal.
bool IsValid() const
Return whether or not this is a valid direction cosines.
static double Dot(const double x[3], const double y[3])
Compute Dot.
static double Norm(const double v[3])
Return norm of the vector.
static void Normalize(double v[3])
Normalize in-place.
void Cross(double z[3]) const
Compute Cross product.
void Normalize()
Normalize in-place.
double CrossDot(DirectionCosines const &dc) const
Compute the Dot product of the two cross vector of both DirectionCosines object.
double Dot() const
Compute Dot.
bool SetFromString(const char *str)
DirectionCosines(const double dircos[6])
void Print(std::ostream &) const
Print.
#define GDCM_EXPORT
Definition gdcmWin32.h:34
Definition gdcmASN1.h:21