GDCM  2.2.3
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 
00046 class GDCM_EXPORT Image : public Pixmap
00047 {
00048 public:
00049   Image ():Spacing(),SC(),Intercept(0),Slope(1) {
00050     //DirectionCosines.resize(6);
00051   Origin.resize( 3 /*NumberOfDimensions*/ ); // fill with 0
00052   DirectionCosines.resize( 6 ); // fill with 0
00053   DirectionCosines[0] = 1;
00054   DirectionCosines[4] = 1;
00055   Spacing.resize( 3 /*NumberOfDimensions*/, 1 ); // fill with 1
00056 
00057   }
00058   ~Image() {}
00059 
00063   const double *GetSpacing() const;
00064   double GetSpacing(unsigned int idx) const;
00065   void SetSpacing(const double *spacing);
00066   void SetSpacing(unsigned int idx, double spacing);
00067 
00070   const double *GetOrigin() const;
00071   double GetOrigin(unsigned int idx) const;
00072   void SetOrigin(const float *ori);
00073   void SetOrigin(const double *ori);
00074   void SetOrigin(unsigned int idx, double ori);
00075 
00078   const double *GetDirectionCosines() const;
00079   double GetDirectionCosines(unsigned int idx) const;
00080   void SetDirectionCosines(const float *dircos);
00081   void SetDirectionCosines(const double *dircos);
00082   void SetDirectionCosines(unsigned int idx, double dircos);
00083 
00085   void Print(std::ostream &os) const;
00086 
00088   void SetIntercept(double intercept) { Intercept = intercept; }
00089   double GetIntercept() const { return Intercept; }
00090 
00092   void SetSlope(double slope) { Slope = slope; }
00093   double GetSlope() const { return Slope; }
00094 
00095 private:
00096   std::vector<double> Spacing;
00097   std::vector<double> Origin;
00098   std::vector<double> DirectionCosines;
00099 
00100   // I believe the following 3 ivars can be derived from TS ...
00101   SwapCode SC;
00102   double Intercept;
00103   double Slope;
00104 };
00105 
00111 } // end namespace gdcm
00112 
00113 #endif //GDCMIMAGE_H

Generated on Thu Nov 28 2013 07:02:50 for GDCM by doxygen 1.7.6.1
SourceForge.net Logo