00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 #ifndef _GDCMORIENTATION_H_
00020 #define _GDCMORIENTATION_H_
00021 
00022 #include "gdcmRefCounter.h"
00023 #include <map>
00024 
00025 namespace GDCM_NAME_SPACE 
00026 {
00027 typedef struct
00028 {
00029    double x;
00030    double y;
00031    double z;
00032 } vector3D;
00033 
00034 typedef std::pair<double, double> Res;
00035 class File;
00036 
00037 typedef enum {
00038    NotApplicable = 0,
00039    Axial = 1,
00040    AxialInvert = -1,
00041    Coronal = 2,
00042    CoronalInvert = -2,
00043    Sagital = 3,
00044    SagitalInvert = -3,
00045    HeartAxial = 4,
00046    HeartAxialInvert = -4,
00047    HeartCoronal = 5,
00048    HeartCoronalInvert = -5,
00049    HeartSagital = 6,
00050    HeartSagitalInvert = -6
00051 } OrientationType;
00052 
00053 
00098 class GDCM_EXPORT Orientation : public RefCounter
00099 {
00100    gdcmTypeMacro(Orientation);
00101 public:
00103    static Orientation *New() {return new Orientation();}
00104 
00105   OrientationType GetOrientationType( File *file );
00106   std::string GetOrientation ( File *file );  
00107   
00108   static const char* GetOrientationTypeString(OrientationType const o);
00109 
00110 protected:
00112   Orientation() {}
00114   ~Orientation() {}
00115 private:
00116    Res VerfCriterion(int typeCriterion, double criterionNew, Res const &res);
00117    double CalculLikelyhood2Vec(vector3D const &refA, vector3D const &refB, 
00118                                vector3D const &ori1, vector3D const &ori2);
00119    vector3D ProductVectorial(vector3D const &vec1, vector3D const &vec2);
00120    std::string GetSingleOrientation ( float *iop);
00121 };
00122 } 
00123 
00124 #endif