gdcmImage.h
Go to the documentation of this file.
/*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#ifndef GDCMIMAGE_H
#define GDCMIMAGE_H
#include "gdcmPixmap.h"
#include <vector>
namespace gdcm
{
class GDCM_EXPORT Image : public Pixmap
{
public:
Image ():Spacing(),SC(),Intercept(0),Slope(1) {
//DirectionCosines.resize(6);
Origin.resize( 3 /*NumberOfDimensions*/ ); // fill with 0
DirectionCosines.resize( 6 ); // fill with 0
DirectionCosines[0] = 1;
DirectionCosines[4] = 1;
Spacing.resize( 3 /*NumberOfDimensions*/, 1 ); // fill with 1
}
~Image() override = default;
const double *GetSpacing() const;
double GetSpacing(unsigned int idx) const;
void SetSpacing(const double spacing[3]);
void SetSpacing(unsigned int idx, double spacing);
const double *GetOrigin() const;
double GetOrigin(unsigned int idx) const;
void SetOrigin(const float origin[3]);
void SetOrigin(const double origin[3]);
void SetOrigin(unsigned int idx, double ori);
const double *GetDirectionCosines() const;
double GetDirectionCosines(unsigned int idx) const;
void SetDirectionCosines(const float dircos[6]);
void SetDirectionCosines(const double dircos[6]);
void SetDirectionCosines(unsigned int idx, double dircos);
void Print(std::ostream &os) const override;
void SetIntercept(double intercept) { Intercept = intercept; }
double GetIntercept() const { return Intercept; }
void SetSlope(double slope) { Slope = slope; }
double GetSlope() const { return Slope; }
private:
std::vector<double> Spacing;
std::vector<double> Origin;
std::vector<double> DirectionCosines;
// I believe the following 3 ivars can be derived from TS ...
SwapCode SC;
double Intercept;
double Slope;
};
} // end namespace gdcm
#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