gdcmImage.h
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
00045 class GDCM_EXPORT Image : public Pixmap
00046 {
00047 public:
00048 Image ():Spacing(),SC(),Intercept(0),Slope(1) {
00049
00050 Origin.resize( 3 );
00051 DirectionCosines.resize( 6 );
00052 DirectionCosines[0] = 1;
00053 DirectionCosines[4] = 1;
00054 Spacing.resize( 3 , 1 );
00055
00056 }
00057 ~Image() {}
00058
00062 const double *GetSpacing() const;
00063 double GetSpacing(unsigned int idx) const;
00064 void SetSpacing(const double *spacing);
00065 void SetSpacing(unsigned int idx, double spacing);
00066
00069 const double *GetOrigin() const;
00070 double GetOrigin(unsigned int idx) const;
00071 void SetOrigin(const float *ori);
00072 void SetOrigin(const double *ori);
00073 void SetOrigin(unsigned int idx, double ori);
00074
00077 const double *GetDirectionCosines() const;
00078 double GetDirectionCosines(unsigned int idx) const;
00079 void SetDirectionCosines(const float *dircos);
00080 void SetDirectionCosines(const double *dircos);
00081 void SetDirectionCosines(unsigned int idx, double dircos);
00082
00084 void Print(std::ostream &os) const;
00085
00087 SwapCode GetSwapCode() const
00088 {
00089 return SC;
00090 }
00091 void SetSwapCode(SwapCode sc)
00092 {
00093 SC = sc;
00094 }
00095
00096
00097
00098
00100 void SetIntercept(double intercept) { Intercept = intercept; }
00101 double GetIntercept() const { return Intercept; }
00102
00104 void SetSlope(double slope) { Slope = slope; }
00105 double GetSlope() const { return Slope; }
00106
00107 private:
00108 std::vector<double> Spacing;
00109 std::vector<double> Origin;
00110 std::vector<double> DirectionCosines;
00111
00112
00113 SwapCode SC;
00114 double Intercept;
00115 double Slope;
00116 };
00117
00123 }
00124
00125 #endif //__gdcmImage_h
00126