# gdcmDirectionCosines.h

Go to the documentation of this file.

    00001 /*=========================================================================
    00002
    00003   Program: GDCM (Grassroots DICOM). A DICOM library
    00004   Module:  $URL$
    00005
    00006   Copyright (c) 2006-2009 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
    00053   bool SetFromString(const char *str);
    00054
    00055   double CrossDot(DirectionCosines const &dc) const;
    00056
    00057   double ComputeDistAlongNormal(const double ipp[3]) const;
    00058
    00059 private:
    00060   double Values[6];
    00061 };
    00062
    00063 } // end namespace gdcm
    00064
    00065 #endif //__gdcmDirectionCosines_h