Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef GDCMIMAGE_H
00016 #define GDCMIMAGE_H
00017
00018 #include "gdcmPixmap.h"
00019 #include "gdcmSwapCode.h"
00020
00021 #include <vector>
00022
00023 namespace gdcm
00024 {
00025
00049 class GDCM_EXPORT Image : public Pixmap
00050 {
00051 public:
00052 Image ():Spacing(),SC(),Intercept(0),Slope(1) {
00053
00054 Origin.resize( 3 );
00055 DirectionCosines.resize( 6 );
00056 DirectionCosines[0] = 1;
00057 DirectionCosines[4] = 1;
00058 Spacing.resize( 3 , 1 );
00059
00060 }
00061 ~Image() {}
00062
00066 const double *GetSpacing() const;
00067 double GetSpacing(unsigned int idx) const;
00068 void SetSpacing(const double *spacing);
00069 void SetSpacing(unsigned int idx, double spacing);
00070
00073 const double *GetOrigin() const;
00074 double GetOrigin(unsigned int idx) const;
00075 void SetOrigin(const float *ori);
00076 void SetOrigin(const double *ori);
00077 void SetOrigin(unsigned int idx, double ori);
00078
00081 const double *GetDirectionCosines() const;
00082 double GetDirectionCosines(unsigned int idx) const;
00083 void SetDirectionCosines(const float *dircos);
00084 void SetDirectionCosines(const double *dircos);
00085 void SetDirectionCosines(unsigned int idx, double dircos);
00086
00088 void Print(std::ostream &os) const;
00089
00091 SwapCode GetSwapCode() const
00092 {
00093 return SC;
00094 }
00095 void SetSwapCode(SwapCode sc)
00096 {
00097 SC = sc;
00098 }
00099
00100
00101
00102
00104 void SetIntercept(double intercept) { Intercept = intercept; }
00105 double GetIntercept() const { return Intercept; }
00106
00108 void SetSlope(double slope) { Slope = slope; }
00109 double GetSlope() const { return Slope; }
00110
00111 private:
00112 std::vector<double> Spacing;
00113 std::vector<double> Origin;
00114 std::vector<double> DirectionCosines;
00115
00116
00117 SwapCode SC;
00118 double Intercept;
00119 double Slope;
00120 };
00121
00127 }
00128
00129 #endif //GDCMIMAGE_H
00130