GDCM  2.2.0
gdcmImage.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: GDCM (Grassroots DICOM). A DICOM library
4 
5  Copyright (c) 2006-2011 Mathieu Malaterre
6  All rights reserved.
7  See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without even
10  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  PURPOSE. See the above copyright notice for more information.
12 
13 =========================================================================*/
14 #ifndef GDCMIMAGE_H
15 #define GDCMIMAGE_H
16 
17 #include "gdcmPixmap.h"
18 
19 #include <vector>
20 
21 namespace gdcm
22 {
23 
47 class GDCM_EXPORT Image : public Pixmap
48 {
49 public:
50  Image ():Spacing(),SC(),Intercept(0),Slope(1) {
51  //DirectionCosines.resize(6);
52  Origin.resize( 3 /*NumberOfDimensions*/ ); // fill with 0
53  DirectionCosines.resize( 6 ); // fill with 0
54  DirectionCosines[0] = 1;
55  DirectionCosines[4] = 1;
56  Spacing.resize( 3 /*NumberOfDimensions*/, 1 ); // fill with 1
57 
58  }
59  ~Image() {}
60 
64  const double *GetSpacing() const;
65  double GetSpacing(unsigned int idx) const;
66  void SetSpacing(const double *spacing);
67  void SetSpacing(unsigned int idx, double spacing);
68 
71  const double *GetOrigin() const;
72  double GetOrigin(unsigned int idx) const;
73  void SetOrigin(const float *ori);
74  void SetOrigin(const double *ori);
75  void SetOrigin(unsigned int idx, double ori);
76 
79  const double *GetDirectionCosines() const;
80  double GetDirectionCosines(unsigned int idx) const;
81  void SetDirectionCosines(const float *dircos);
82  void SetDirectionCosines(const double *dircos);
83  void SetDirectionCosines(unsigned int idx, double dircos);
84 
86  void Print(std::ostream &os) const;
87 
89  void SetIntercept(double intercept) { Intercept = intercept; }
90  double GetIntercept() const { return Intercept; }
91 
93  void SetSlope(double slope) { Slope = slope; }
94  double GetSlope() const { return Slope; }
95 
96 private:
97  std::vector<double> Spacing;
98  std::vector<double> Origin;
99  std::vector<double> DirectionCosines;
100 
101  // I believe the following 3 ivars can be derived from TS ...
102  SwapCode SC;
103  double Intercept;
104  double Slope;
105 };
106 
112 } // end namespace gdcm
113 
114 #endif //GDCMIMAGE_H

Generated on Wed Jun 13 2012 20:40:37 for GDCM by doxygen 1.8.1
SourceForge.net Logo