GDCM  2.2.6
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
Pixmap class A bitmap based image. Used as parent for both IconImage and the main Pixel Data Image It...
Definition: gdcmPixmap.h:32
#define GDCM_EXPORT
Definition: gdcmWin32.h:34
void SetIntercept(double intercept)
intercept
Definition: gdcmImage.h:88
void SetSlope(double slope)
slope
Definition: gdcmImage.h:92
double GetSlope() const
Definition: gdcmImage.h:93
Class for Spacing.
Definition: gdcmSpacing.h:85
~Image()
Definition: gdcmImage.h:58
class to handle DirectionCosines
Definition: gdcmDirectionCosines.h:25
double GetIntercept() const
Definition: gdcmImage.h:89
SwapCode representation.
Definition: gdcmSwapCode.h:27
Image This is the container for an Image in the general sense. From this container you should be able...
Definition: gdcmImage.h:46
Image()
Definition: gdcmImage.h:49

Generated on Sat Dec 21 2013 05:56:17 for GDCM by doxygen 1.8.5
SourceForge.net Logo