GDCM 3.2.1

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