GDCM 2.2.1

- Main Page
- Related Pages
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

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
46 class GDCM_EXPORT Image : public Pixmap
47 {
48 public:
49 Image ():Spacing(),SC(),Intercept(0),Slope(1) {
50 //DirectionCosines.resize(6);
51 Origin.resize( 3 /*NumberOfDimensions*/ ); // fill with 0
52 DirectionCosines.resize( 6 ); // fill with 0
53 DirectionCosines[0] = 1;
54 DirectionCosines[4] = 1;
55 Spacing.resize( 3 /*NumberOfDimensions*/, 1 ); // fill with 1
56
57 }
58 ~Image() {}
59
63 const double *GetSpacing() const;
64 double GetSpacing(unsigned int idx) const;
65 void SetSpacing(const double *spacing);
66 void SetSpacing(unsigned int idx, double spacing);
67
70 const double *GetOrigin() const;
71 double GetOrigin(unsigned int idx) const;
72 void SetOrigin(const float *ori);
73 void SetOrigin(const double *ori);
74 void SetOrigin(unsigned int idx, double ori);
75
78 const double *GetDirectionCosines() const;
79 double GetDirectionCosines(unsigned int idx) const;
80 void SetDirectionCosines(const float *dircos);
81 void SetDirectionCosines(const double *dircos);
82 void SetDirectionCosines(unsigned int idx, double dircos);
83
85 void Print(std::ostream &os) const;
86
88 void SetIntercept(double intercept) { Intercept = intercept; }
89 double GetIntercept() const { return Intercept; }
90
92 void SetSlope(double slope) { Slope = slope; }
93 double GetSlope() const { return Slope; }
94
95 private:
96 std::vector<double> Spacing;
97 std::vector<double> Origin;
98 std::vector<double> DirectionCosines;
99
100 // I believe the following 3 ivars can be derived from TS ...
101 SwapCode SC;
102 double Intercept;
103 double Slope;
104 };
105
111 } // end namespace gdcm
112
113 #endif //GDCMIMAGE_H