OFFIS DCMTK  Version 3.6.0
dctypes.h
1 /*
2  *
3  * Copyright (C) 1994-2010, OFFIS e.V.
4  * All rights reserved. See COPYRIGHT file for details.
5  *
6  * This software and supporting documentation were developed by
7  *
8  * OFFIS e.V.
9  * R&D Division Health
10  * Escherweg 2
11  * D-26121 Oldenburg, Germany
12  *
13  *
14  * Module: dcmdata
15  *
16  * Author: Gerd Ehlers, Andrew Hewett
17  *
18  * Purpose: global type and constant definitions
19  *
20  * Last Update: $Author: joergr $
21  * Update Date: $Date: 2010-10-29 10:57:17 $
22  * CVS/RCS Revision: $Revision: 1.35 $
23  * Status: $State: Exp $
24  *
25  * CVS/RCS Log at end of file
26  *
27  */
28 
29 
30 #ifndef DCTYPES_H
31 #define DCTYPES_H 1
32 
33 #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */
34 #include "dcmtk/oflog/oflog.h"
35 
36 #define INCLUDE_CSTDLIB
37 #include "dcmtk/ofstd/ofstdinc.h"
38 
39 BEGIN_EXTERN_C
40 #ifdef HAVE_SYS_TYPES_H
41 /* needed e.g. on Solaris for definition of size_t */
42 #include <sys/types.h>
43 #endif
44 END_EXTERN_C
45 
46 /*
47 ** Logging
48 */
49 
50 OFLogger DCM_dcmdataGetLogger();
51 
52 #define DCMDATA_TRACE(msg) OFLOG_TRACE(DCM_dcmdataGetLogger(), msg)
53 #define DCMDATA_DEBUG(msg) OFLOG_DEBUG(DCM_dcmdataGetLogger(), msg)
54 #define DCMDATA_INFO(msg) OFLOG_INFO(DCM_dcmdataGetLogger(), msg)
55 #define DCMDATA_WARN(msg) OFLOG_WARN(DCM_dcmdataGetLogger(), msg)
56 #define DCMDATA_ERROR(msg) OFLOG_ERROR(DCM_dcmdataGetLogger(), msg)
57 #define DCMDATA_FATAL(msg) OFLOG_FATAL(DCM_dcmdataGetLogger(), msg)
58 
59 /*
60 ** Macro Definitions
61 */
62 
64 #define DCMTK_XML_NAMESPACE_URI "http://dicom.offis.de/dcmtk"
65 
66 // ANSI escape codes for color output of the print() method
67 #define ANSI_ESCAPE_CODE_RESET "\033[0m"
68 #define ANSI_ESCAPE_CODE_TAG "\033[22m\033[32m"
69 #define ANSI_ESCAPE_CODE_VR "\033[22m\033[31m"
70 #define ANSI_ESCAPE_CODE_VALUE "\033[1m\033[37m"
71 #define ANSI_ESCAPE_CODE_INFO "\033[1m\033[30m"
72 #define ANSI_ESCAPE_CODE_LENGTH "\033[22m\033[36m"
73 #define ANSI_ESCAPE_CODE_VM "\033[22m\033[35m"
74 #define ANSI_ESCAPE_CODE_NAME "\033[22m\033[33m"
75 #define ANSI_ESCAPE_CODE_NAME_1 "\033[1m\033[33m"
76 #define ANSI_ESCAPE_CODE_SEQUENCE "\033[22m\033[32m"
77 #define ANSI_ESCAPE_CODE_SEQUENCE_1 "\033[1m\033[32m"
78 #define ANSI_ESCAPE_CODE_ITEM "\033[1m\033[30m"
79 #define ANSI_ESCAPE_CODE_LINE "\033[1m\033[30m"
80 #define ANSI_ESCAPE_CODE_COMMENT "\033[1m\033[30m"
81 
82 
83 /*
84 ** Enumerated Types
85 */
86 
88 typedef enum {
90  EET_ExplicitLength = 0,
92  EET_UndefinedLength = 1
93 } E_EncodingType;
94 
95 
97 typedef enum {
99  EGL_noChange = 0,
101  EGL_withoutGL = 1,
103  EGL_withGL = 2,
105  EGL_recalcGL = 3
106 } E_GrpLenEncoding;
107 
109 typedef enum {
111  EPD_noChange = 0,
113  EPD_withoutPadding = 1,
115  EPD_withPadding = 2
116 } E_PaddingEncoding;
117 
119 typedef enum {
121  ESM_fromHere = 0,
123  ESM_fromStackTop = 1,
125  ESM_afterStackTop = 2
126 } E_SearchMode;
127 
129 typedef enum {
131  ERW_init = 0,
133  ERW_ready = 1,
135  ERW_inWork = 2,
137  ERW_notInitialized = 3
138 } E_TransferState;
139 
141 typedef enum {
143  ERM_autoDetect = 0,
145  ERM_dataset = 1,
147  ERM_fileOnly = 2,
149  ERM_metaOnly = 3
150 } E_FileReadMode;
151 
153 typedef enum {
155  EWM_fileformat = 0,
157  EWM_dataset = 1,
159  EWM_updateMeta = 2,
161  EWM_createNewMeta = 3,
163  EWM_dontUpdateMeta = 4
164 } E_FileWriteMode;
165 
166 
169 struct DCMTypes
170 {
171  public:
172 
177 
179  static const size_t PF_shortenLongTagValues;
180 
182  static const size_t PF_showTreeStructure;
183 
185  static const size_t PF_doNotMapUIDsToNames;
186 
188  static const size_t PF_convertToMarkup;
189 
191  static const size_t PF_useANSIEscapeCodes;
193 
198 
200  static const size_t XF_addDocumentType;
201 
203  static const size_t XF_writeBinaryData;
204 
206  static const size_t XF_encodeBase64;
207 
209  static const size_t XF_useDcmtkNamespace;
210 
212  static const size_t XF_embedDocumentType;
213 
215  static const size_t XF_omitDataElementName;
217 };
218 
219 
220 // Undefined Length Identifier
221 const Uint32 DCM_UndefinedLength = 0xffffffff;
222 
223 
224 #endif /* !DCTYPES_H */
225 
226 
227 /*
228  * CVS/RCS Log:
229  * $Log: dctypes.h,v $
230  * Revision 1.35 2010-10-29 10:57:17 joergr
231  * Added support for colored output to the print() method.
232  *
233  * Revision 1.34 2010-10-14 13:15:42 joergr
234  * Updated copyright header. Added reference to COPYRIGHT file.
235  *
236  * Revision 1.33 2010-06-07 13:57:57 joergr
237  * Added new file read mode that allows for loading the meta-header only.
238  *
239  * Revision 1.32 2010-03-01 09:08:44 uli
240  * Removed some unnecessary include directives in the headers.
241  *
242  * Revision 1.31 2009-11-04 09:58:07 uli
243  * Switched to logging mechanism provided by the "new" oflog module
244  *
245  * Revision 1.30 2009-08-21 10:45:06 joergr
246  * Added new 'writeMode' which does not update the the meta header. This could
247  * be useful for tools like dump2dcm and xml2dcm.
248  *
249  * Revision 1.29 2009-08-21 09:17:16 joergr
250  * Added parameter 'writeMode' to save/write methods which allows for specifying
251  * whether to write a dataset or fileformat as well as whether to update the
252  * file meta information or to create a new file meta information header.
253  *
254  * Revision 1.28 2009-08-19 11:55:44 meichel
255  * Added additional includes needed for Sun Studio 11 on Solaris.
256  *
257  * Revision 1.27 2009-01-06 16:28:11 joergr
258  * Reworked print() output format for option PF_showTreeStructure.
259  *
260  * Revision 1.26 2008-04-28 09:22:42 meichel
261  * New flag DCMTypes::PF_convertToMarkup causes DcmObject::print to
262  * quote non-ASCII string content as XML markup
263  *
264  * Revision 1.25 2008-02-26 16:56:15 joergr
265  * Added new print flag that disables the mapping of well-known UID numbers to
266  * their associated names (e.g. transfer syntax or SOP class).
267  *
268  * Revision 1.24 2007/11/29 14:30:35 meichel
269  * Updated doxygen API documentation
270  *
271  * Revision 1.23 2006/05/11 08:55:22 joergr
272  * Added new option that allows to omit the element name in the XML output.
273  *
274  * Revision 1.22 2006/02/08 15:21:15 joergr
275  * Removed unused type definitions.
276  *
277  * Revision 1.21 2005/12/08 16:28:47 meichel
278  * Changed include path schema for all DCMTK header files
279  *
280  * Revision 1.20 2005/12/02 08:50:30 joergr
281  * Added new file read mode that makes it possible to distinguish between DICOM
282  * files, datasets and other non-DICOM files.
283  *
284  * Revision 1.19 2003/04/22 08:19:09 joergr
285  * Added new command line option which allows to embed the content of the DTD
286  * instead of referencing the DTD file.
287  *
288  * Revision 1.18 2003/04/01 14:57:08 joergr
289  * Added support for XML namespaces.
290  *
291  * Revision 1.17 2002/12/06 12:21:00 joergr
292  * Enhanced "print()" function by re-working the implementation and replacing
293  * the boolean "showFullData" parameter by a more general integer flag.
294  *
295  * Revision 1.16 2002/11/27 12:07:23 meichel
296  * Adapted module dcmdata to use of new header file ofstdinc.h
297  *
298  * Revision 1.15 2002/07/10 11:45:40 meichel
299  * Moved definitions for Uint8, Sint8 ... Float64 from dcmdata to ofstd
300  * since these types are not DICOM specific
301  *
302  * Revision 1.14 2002/06/06 14:51:13 meichel
303  * Corrected code for inclusion of stdlib.h
304  *
305  * Revision 1.13 2002/05/14 08:20:29 joergr
306  * Added support for Base64 (MIME) encoded binary data.
307  *
308  * Revision 1.12 2002/04/25 10:07:13 joergr
309  * Added support for XML output of DICOM objects.
310  *
311  * Revision 1.11 2001/06/01 15:48:45 meichel
312  * Updated copyright header
313  *
314  * Revision 1.10 2000/03/08 16:26:19 meichel
315  * Updated copyright header.
316  *
317  * Revision 1.9 2000/03/03 14:05:26 meichel
318  * Implemented library support for redirecting error messages into memory
319  * instead of printing them to stdout/stderr for GUI applications.
320  *
321  * Revision 1.8 2000/02/07 14:44:45 meichel
322  * The typedef for Sint8 now defaults to char instead of signed char.
323  * This avoids warnings on certain c-front related compilers.
324  * The old behaviour can be restored by compiling with the symbol
325  * CHAR_IS_UNSIGNED defined.
326  *
327  * Revision 1.7 1999/03/31 09:24:51 meichel
328  * Updated copyright header in module dcmdata
329  *
330  *
331  */


Generated on Thu Dec 20 2012 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.8.2