GDCM: gdcmImage.h Source File

GDCM 3.2.5

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
46 class 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
110
111} // end namespace gdcm
112
113#endif //GDCMIMAGE_H
gdcm::DirectionCosines
class to handle DirectionCosines
Definition gdcmDirectionCosines.h:26
gdcm::Image::GetDirectionCosines
double GetDirectionCosines(unsigned int idx) const
gdcm::Image::SetSpacing
void SetSpacing(const double spacing[3])
gdcm::Image::GetSpacing
double GetSpacing(unsigned int idx) const
gdcm::Image::SetSlope
void SetSlope(double slope)
slope
Definition gdcmImage.h:92
gdcm::Image::Print
void Print(std::ostream &os) const override
print
gdcm::Image::SetDirectionCosines
void SetDirectionCosines(const float dircos[6])
gdcm::Image::SetOrigin
void SetOrigin(unsigned int idx, double ori)
gdcm::Image::GetDirectionCosines
const double * GetDirectionCosines() const
gdcm::Image::~Image
~Image() override=default
gdcm::Image::GetSlope
double GetSlope() const
Definition gdcmImage.h:93
gdcm::Image::Image
Image()
Definition gdcmImage.h:49
gdcm::Image::SetDirectionCosines
void SetDirectionCosines(unsigned int idx, double dircos)
gdcm::Image::SetOrigin
void SetOrigin(const double origin[3])
gdcm::Image::GetOrigin
const double * GetOrigin() const
gdcm::Image::SetOrigin
void SetOrigin(const float origin[3])
gdcm::Image::SetDirectionCosines
void SetDirectionCosines(const double dircos[6])
gdcm::Image::SetSpacing
void SetSpacing(unsigned int idx, double spacing)
gdcm::Image::GetSpacing
const double * GetSpacing() const
gdcm::Image::SetIntercept
void SetIntercept(double intercept)
intercept
Definition gdcmImage.h:88
gdcm::Image::GetIntercept
double GetIntercept() const
Definition gdcmImage.h:89
gdcm::Image::GetOrigin
double GetOrigin(unsigned int idx) const
gdcm::Pixmap::Pixmap
Pixmap()
gdcm::Spacing
Class for Spacing.
Definition gdcmSpacing.h:86
gdcm::SwapCode
SwapCode representation.
Definition gdcmSwapCode.h:27
gdcmPixmap.h
GDCM_EXPORT
#define GDCM_EXPORT
Definition gdcmWin32.h:34
gdcm
Definition gdcmASN1.h:21