GDCM 3.0.24
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
21namespace gdcm
22{
23
46class GDCM_EXPORT Image : public Pixmap
47{
48public:
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() override = default;
59
63 const double *GetSpacing() const;
64 double GetSpacing(unsigned int idx) const;
65 void SetSpacing(const double spacing[3]);
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 origin[3]);
73 void SetOrigin(const double origin[3]);
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[6]);
81 void SetDirectionCosines(const double dircos[6]);
82 void SetDirectionCosines(unsigned int idx, double dircos);
83
85 void Print(std::ostream &os) const override;
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
95private:
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
class to handle DirectionCosines
Definition gdcmDirectionCosines.h:26
Image.
Definition gdcmImage.h:47
double GetDirectionCosines(unsigned int idx) const
void SetSpacing(const double spacing[3])
double GetSpacing(unsigned int idx) const
void SetSlope(double slope)
slope
Definition gdcmImage.h:92
void Print(std::ostream &os) const override
print
void SetDirectionCosines(const float dircos[6])
void SetOrigin(unsigned int idx, double ori)
const double * GetDirectionCosines() const
~Image() override=default
double GetSlope() const
Definition gdcmImage.h:93
Image()
Definition gdcmImage.h:49
void SetDirectionCosines(unsigned int idx, double dircos)
void SetOrigin(const double origin[3])
const double * GetOrigin() const
void SetOrigin(const float origin[3])
void SetDirectionCosines(const double dircos[6])
void SetSpacing(unsigned int idx, double spacing)
const double * GetSpacing() const
void SetIntercept(double intercept)
intercept
Definition gdcmImage.h:88
double GetIntercept() const
Definition gdcmImage.h:89
double GetOrigin(unsigned int idx) const
Pixmap class.
Definition gdcmPixmap.h:33
Class for Spacing.
Definition gdcmSpacing.h:86
SwapCode representation.
Definition gdcmSwapCode.h:27
#define GDCM_EXPORT
Definition gdcmWin32.h:34
Definition gdcmASN1.h:21