GDCM  2.2.6
gdcmDictConverter.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 
15 #ifndef GDCMDICTCONVERTER_H
16 #define GDCMDICTCONVERTER_H
17 
18 #include "gdcmTypes.h"
19 #include "gdcmVR.h"
20 #include "gdcmVM.h"
21 
22 #include <string>
23 
24 namespace gdcm
25 {
26 
27 class DictConverterInternal;
36 {
37 public:
38  DictConverter();
39  ~DictConverter();
40  void SetInputFileName(const char* filename);
41  const std::string &GetInputFilename() const;
42  void SetOutputFileName(const char* filename);
43  const std::string &GetOutputFilename() const;
44 
45  int GetOutputType() const {
46  return OutputType;
47  }
48  void SetOutputType(int type) {
49  OutputType = type;
50  }
51  const std::string &GetDictName() const;
52  void SetDictName(const char *name);
53 
54  void Convert();
55 
56  // Leaving them public for now. Not really user oriented but may be
57  // usefull
58  static bool ReadVR(const char *raw, VR::VRType &type);
59  static bool ReadVM(const char *raw, VM::VMType &type);
60  static bool Readuint16(const char *raw, uint16_t &ov);
61 
62  enum OutputTypes {
63  DICT_DEFAULT = 0,
65  DICT_XML
66  };
67 
68 protected:
69  void WriteHeader();
70  void WriteFooter();
71  bool ConvertToXML(const char *raw, std::string &cxx);
72  bool ConvertToCXX(const char *raw, std::string &cxx);
73  void AddGroupLength();
74 
75 private:
76  DictConverterInternal *Internal;
77 
78  int OutputType;
79 };
80 
81 } // end namespace gdcm
82 
83 #endif //GDCMDICTCONVERTER_H
VRType
Definition: gdcmVR.h:57
#define GDCM_EXPORT
Definition: gdcmWin32.h:34
OutputTypes
Definition: gdcmDictConverter.h:62
Class to convert a .dic file into something else:
Definition: gdcmDictConverter.h:35
Definition: gdcmDictConverter.h:64
int GetOutputType() const
Definition: gdcmDictConverter.h:45
void SetOutputType(int type)
Definition: gdcmDictConverter.h:48
VMType
Definition: gdcmVM.h:70

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