GDCM  2.2.6
gdcmImageHelper.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 GDCMIMAGEHELPER_H
15 #define GDCMIMAGEHELPER_H
16 
17 #include "gdcmTypes.h"
18 #include "gdcmTag.h"
19 #include <vector>
20 #include "gdcmPixelFormat.h"
22 #include "gdcmSmartPointer.h"
23 #include "gdcmLookupTable.h"
24 
25 namespace gdcm
26 {
27 
28 class MediaStorage;
29 class DataSet;
30 class File;
31 class Image;
32 class ByteValue;
49 {
50 public:
56  static void SetForceRescaleInterceptSlope(bool);
57  static bool GetForceRescaleInterceptSlope();
58 
65  static void SetForcePixelSpacing(bool);
66  static bool GetForcePixelSpacing();
67 
71  static std::vector<unsigned int> GetDimensionsValue(const File& f);
72  static void SetDimensionsValue(File& f, const Image & img);
73 
76  static PixelFormat GetPixelFormatValue(const File& f);
77 
82  static std::vector<double> GetRescaleInterceptSlopeValue(File const & f);
83  static void SetRescaleInterceptSlopeValue(File & f, const Image & img);
84 
86  static std::vector<double> GetOriginValue(File const & f);
87  static void SetOriginValue(DataSet & ds, const Image & img);
88 
91  static std::vector<double> GetDirectionCosinesValue(File const & f);
97  // FIXME: There is a major issue for image with multiple IOP (eg. Enhanced * Image Storage).
98  static void SetDirectionCosinesValue(DataSet & ds, const std::vector<double> & dircos);
99 
101  static std::vector<double> GetSpacingValue(File const & f);
102  static void SetSpacingValue(DataSet & ds, const std::vector<double> & spacing);
103 
105  static bool ComputeSpacingFromImagePositionPatient(const std::vector<double> &imageposition, std::vector<double> & spacing);
106 
107  static bool GetDirectionCosinesFromDataSet(DataSet const & ds, std::vector<double> & dircos);
108 
109  //functions to get more information from a file
110  //useful for the stream image reader, which fills in necessary image information
111  //distinctly from the reader-style data input
112  static PhotometricInterpretation GetPhotometricInterpretationValue(File const& f);
113  //returns the configuration of colors in a plane, either RGB RGB RGB or RRR GGG BBB
114  static unsigned int GetPlanarConfigurationValue(const File& f);
115 
116  //returns the lookup table of an image file
117  static SmartPointer<LookupTable> GetLUT(File const& f);
118 
120  static const ByteValue* GetPointerFromElement(Tag const &tag, File const& f);
121 
122 protected:
123  static Tag GetSpacingTagFromMediaStorage(MediaStorage const &ms);
124  static Tag GetZSpacingTagFromMediaStorage(MediaStorage const &ms);
125 
126 private:
127  static bool ForceRescaleInterceptSlope;
128  static bool ForcePixelSpacing;
129 };
130 
131 } // end namespace gdcm
132 
133 #endif // GDCMIMAGEHELPER_H
Class to represent a Data Set (which contains Data Elements) A Data Set represents an instance of a r...
Definition: gdcmDataSet.h:55
#define GDCM_EXPORT
Definition: gdcmWin32.h:34
Class to represent binary value (array of bytes)
Definition: gdcmByteValue.h:33
a DICOM File See PS 3.10 File: A File is an ordered string of zero or more bytes, where the first byt...
Definition: gdcmFile.h:33
Class to represent an PhotometricInterpretation.
Definition: gdcmPhotometricInterpretation.h:28
Class to represent a DICOM Data Element (Attribute) Tag (Group, Element). Basically an uint32_t which...
Definition: gdcmTag.h:38
Image This is the container for an Image in the general sense. From this container you should be able...
Definition: gdcmImage.h:46
PixelFormat.
Definition: gdcmPixelFormat.h:36
ImageHelper (internal class, not intended for user level)
Definition: gdcmImageHelper.h:48
MediaStorage.
Definition: gdcmMediaStorage.h:41

Generated on Sat Dec 21 2013 05:56:17 for GDCM by doxygen 1.8.5
SourceForge.net Logo