GDCM  2.2.0
gdcmImage.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program: GDCM (Grassroots DICOM). A DICOM library
00004 
00005   Copyright (c) 2006-2011 Mathieu Malaterre
00006   All rights reserved.
00007   See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
00008 
00009      This software is distributed WITHOUT ANY WARRANTY; without even
00010      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00011      PURPOSE.  See the above copyright notice for more information.
00012 
00013 =========================================================================*/
00014 #ifndef GDCMIMAGE_H
00015 #define GDCMIMAGE_H
00016 
00017 #include "gdcmPixmap.h"
00018 
00019 #include <vector>
00020 
00021 namespace gdcm
00022 {
00023 
00047 class GDCM_EXPORT Image : public Pixmap
00048 {
00049 public:
00050   Image ():Spacing(),SC(),Intercept(0),Slope(1) {
00051     //DirectionCosines.resize(6);
00052   Origin.resize( 3 /*NumberOfDimensions*/ ); // fill with 0
00053   DirectionCosines.resize( 6 ); // fill with 0
00054   DirectionCosines[0] = 1;
00055   DirectionCosines[4] = 1;
00056   Spacing.resize( 3 /*NumberOfDimensions*/, 1 ); // fill with 1
00057 
00058   }
00059   ~Image() {}
00060 
00064   const double *GetSpacing() const;
00065   double GetSpacing(unsigned int idx) const;
00066   void SetSpacing(const double *spacing);
00067   void SetSpacing(unsigned int idx, double spacing);
00068 
00071   const double *GetOrigin() const;
00072   double GetOrigin(unsigned int idx) const;
00073   void SetOrigin(const float *ori);
00074   void SetOrigin(const double *ori);
00075   void SetOrigin(unsigned int idx, double ori);
00076 
00079   const double *GetDirectionCosines() const;
00080   double GetDirectionCosines(unsigned int idx) const;
00081   void SetDirectionCosines(const float *dircos);
00082   void SetDirectionCosines(const double *dircos);
00083   void SetDirectionCosines(unsigned int idx, double dircos);
00084 
00086   void Print(std::ostream &os) const;
00087 
00089   void SetIntercept(double intercept) { Intercept = intercept; }
00090   double GetIntercept() const { return Intercept; }
00091 
00093   void SetSlope(double slope) { Slope = slope; }
00094   double GetSlope() const { return Slope; }
00095 
00096 private:
00097   std::vector<double> Spacing;
00098   std::vector<double> Origin;
00099   std::vector<double> DirectionCosines;
00100 
00101   // I believe the following 3 ivars can be derived from TS ...
00102   SwapCode SC;
00103   double Intercept;
00104   double Slope;
00105 };
00106 
00112 } // end namespace gdcm
00113 
00114 #endif //GDCMIMAGE_H

Generated on Sun Jun 3 2012 15:26:48 for GDCM by doxygen 1.8.0
SourceForge.net Logo