GDCM 2.0.17
|
00001 /*========================================================================= 00002 00003 Program: GDCM (Grassroots DICOM). A DICOM library 00004 Module: $URL$ 00005 00006 Copyright (c) 2006-2010 Mathieu Malaterre 00007 All rights reserved. 00008 See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00015 #ifndef GDCMDIRECTIONCOSINES_H 00016 #define GDCMDIRECTIONCOSINES_H 00017 00018 #include "gdcmTypes.h" 00019 00020 namespace gdcm 00021 { 00022 00026 class GDCM_EXPORT DirectionCosines 00027 { 00028 public: 00029 DirectionCosines(); 00030 DirectionCosines(const double dircos[6]); 00031 // Cannot get the following signature to be wrapped with swig... 00032 //DirectionCosines(const double *dircos = 0 ); 00033 ~DirectionCosines(); 00034 00036 void Print(std::ostream &) const; 00037 00039 void Cross(double z[3]) const; 00040 00042 double Dot() const; 00043 00045 void Normalize(); 00046 00048 operator const double* () const { return Values; } 00049 00051 bool IsValid() const; 00052 00055 bool SetFromString(const char *str); 00056 00058 double CrossDot(DirectionCosines const &dc) const; 00059 00061 double ComputeDistAlongNormal(const double ipp[3]) const; 00062 00063 private: 00064 double Values[6]; 00065 }; 00066 00067 } // end namespace gdcm 00068 00069 #endif //GDCMDIRECTIONCOSINES_H