dcmdata/include/dcmtk/dcmdata/dctypes.h

00001 /*
00002  *
00003  *  Copyright (C) 1994-2010, OFFIS e.V.
00004  *  All rights reserved.  See COPYRIGHT file for details.
00005  *
00006  *  This software and supporting documentation were developed by
00007  *
00008  *    OFFIS e.V.
00009  *    R&D Division Health
00010  *    Escherweg 2
00011  *    D-26121 Oldenburg, Germany
00012  *
00013  *
00014  *  Module:  dcmdata
00015  *
00016  *  Author:  Gerd Ehlers, Andrew Hewett
00017  *
00018  *  Purpose: global type and constant definitions
00019  *
00020  *  Last Update:      $Author: joergr $
00021  *  Update Date:      $Date: 2010-10-29 10:57:17 $
00022  *  CVS/RCS Revision: $Revision: 1.35 $
00023  *  Status:           $State: Exp $
00024  *
00025  *  CVS/RCS Log at end of file
00026  *
00027  */
00028 
00029 
00030 #ifndef DCTYPES_H
00031 #define DCTYPES_H 1
00032 
00033 #include "dcmtk/config/osconfig.h"    /* make sure OS specific configuration is included first */
00034 #include "dcmtk/oflog/oflog.h"
00035 
00036 #define INCLUDE_CSTDLIB
00037 #include "dcmtk/ofstd/ofstdinc.h"
00038 
00039 BEGIN_EXTERN_C
00040 #ifdef HAVE_SYS_TYPES_H
00041 /* needed e.g. on Solaris for definition of size_t */
00042 #include <sys/types.h>
00043 #endif
00044 END_EXTERN_C
00045 
00046 /*
00047 ** Logging
00048 */
00049 
00050 OFLogger DCM_dcmdataGetLogger();
00051 
00052 #define DCMDATA_TRACE(msg) OFLOG_TRACE(DCM_dcmdataGetLogger(), msg)
00053 #define DCMDATA_DEBUG(msg) OFLOG_DEBUG(DCM_dcmdataGetLogger(), msg)
00054 #define DCMDATA_INFO(msg)  OFLOG_INFO(DCM_dcmdataGetLogger(), msg)
00055 #define DCMDATA_WARN(msg)  OFLOG_WARN(DCM_dcmdataGetLogger(), msg)
00056 #define DCMDATA_ERROR(msg) OFLOG_ERROR(DCM_dcmdataGetLogger(), msg)
00057 #define DCMDATA_FATAL(msg) OFLOG_FATAL(DCM_dcmdataGetLogger(), msg)
00058 
00059 /*
00060 ** Macro Definitions
00061 */
00062 
00064 #define DCMTK_XML_NAMESPACE_URI "http://dicom.offis.de/dcmtk"
00065 
00066 // ANSI escape codes for color output of the print() method
00067 #define ANSI_ESCAPE_CODE_RESET      "\033[0m"
00068 #define ANSI_ESCAPE_CODE_TAG        "\033[22m\033[32m"
00069 #define ANSI_ESCAPE_CODE_VR         "\033[22m\033[31m"
00070 #define ANSI_ESCAPE_CODE_VALUE      "\033[1m\033[37m"
00071 #define ANSI_ESCAPE_CODE_INFO       "\033[1m\033[30m"
00072 #define ANSI_ESCAPE_CODE_LENGTH     "\033[22m\033[36m"
00073 #define ANSI_ESCAPE_CODE_VM         "\033[22m\033[35m"
00074 #define ANSI_ESCAPE_CODE_NAME       "\033[22m\033[33m"
00075 #define ANSI_ESCAPE_CODE_NAME_1     "\033[1m\033[33m"
00076 #define ANSI_ESCAPE_CODE_SEQUENCE   "\033[22m\033[32m"
00077 #define ANSI_ESCAPE_CODE_SEQUENCE_1 "\033[1m\033[32m"
00078 #define ANSI_ESCAPE_CODE_ITEM       "\033[1m\033[30m"
00079 #define ANSI_ESCAPE_CODE_LINE       "\033[1m\033[30m"
00080 #define ANSI_ESCAPE_CODE_COMMENT    "\033[1m\033[30m"
00081 
00082 
00083 /*
00084 ** Enumerated Types
00085 */
00086 
00088 typedef enum {
00090     EET_ExplicitLength = 0,
00092     EET_UndefinedLength = 1
00093 } E_EncodingType;
00094 
00095 
00097 typedef enum {
00099     EGL_noChange = 0,
00101     EGL_withoutGL = 1,
00103     EGL_withGL = 2,
00105     EGL_recalcGL = 3
00106 } E_GrpLenEncoding;
00107 
00109 typedef enum {
00111     EPD_noChange = 0,
00113     EPD_withoutPadding = 1,
00115     EPD_withPadding = 2
00116 } E_PaddingEncoding;
00117 
00119 typedef enum {
00121     ESM_fromHere = 0,
00123     ESM_fromStackTop = 1,
00125     ESM_afterStackTop = 2
00126 } E_SearchMode;
00127 
00129 typedef enum {
00131     ERW_init = 0,
00133     ERW_ready = 1,
00135     ERW_inWork = 2,
00137     ERW_notInitialized = 3
00138 } E_TransferState;
00139 
00141 typedef enum {
00143     ERM_autoDetect = 0,
00145     ERM_dataset = 1,
00147     ERM_fileOnly = 2,
00149     ERM_metaOnly = 3
00150 } E_FileReadMode;
00151 
00153 typedef enum {
00155     EWM_fileformat = 0,
00157     EWM_dataset = 1,
00159     EWM_updateMeta = 2,
00161     EWM_createNewMeta = 3,
00163     EWM_dontUpdateMeta = 4
00164 } E_FileWriteMode;
00165 
00166 
00169 struct DCMTypes
00170 {
00171   public:
00172 
00177 
00179     static const size_t PF_shortenLongTagValues;
00180 
00182     static const size_t PF_showTreeStructure;
00183 
00185     static const size_t PF_doNotMapUIDsToNames;
00186 
00188     static const size_t PF_convertToMarkup;
00189 
00191     static const size_t PF_useANSIEscapeCodes;
00193 
00198 
00200     static const size_t XF_addDocumentType;
00201 
00203     static const size_t XF_writeBinaryData;
00204 
00206     static const size_t XF_encodeBase64;
00207 
00209     static const size_t XF_useDcmtkNamespace;
00210 
00212     static const size_t XF_embedDocumentType;
00213 
00215     static const size_t XF_omitDataElementName;
00217 };
00218 
00219 
00220 // Undefined Length Identifier
00221 const Uint32 DCM_UndefinedLength = 0xffffffff;
00222 
00223 
00224 #endif /* !DCTYPES_H */
00225 
00226 
00227 /*
00228  * CVS/RCS Log:
00229  * $Log: dctypes.h,v $
00230  * Revision 1.35  2010-10-29 10:57:17  joergr
00231  * Added support for colored output to the print() method.
00232  *
00233  * Revision 1.34  2010-10-14 13:15:42  joergr
00234  * Updated copyright header. Added reference to COPYRIGHT file.
00235  *
00236  * Revision 1.33  2010-06-07 13:57:57  joergr
00237  * Added new file read mode that allows for loading the meta-header only.
00238  *
00239  * Revision 1.32  2010-03-01 09:08:44  uli
00240  * Removed some unnecessary include directives in the headers.
00241  *
00242  * Revision 1.31  2009-11-04 09:58:07  uli
00243  * Switched to logging mechanism provided by the "new" oflog module
00244  *
00245  * Revision 1.30  2009-08-21 10:45:06  joergr
00246  * Added new 'writeMode' which does not update the the meta header. This could
00247  * be useful for tools like dump2dcm and xml2dcm.
00248  *
00249  * Revision 1.29  2009-08-21 09:17:16  joergr
00250  * Added parameter 'writeMode' to save/write methods which allows for specifying
00251  * whether to write a dataset or fileformat as well as whether to update the
00252  * file meta information or to create a new file meta information header.
00253  *
00254  * Revision 1.28  2009-08-19 11:55:44  meichel
00255  * Added additional includes needed for Sun Studio 11 on Solaris.
00256  *
00257  * Revision 1.27  2009-01-06 16:28:11  joergr
00258  * Reworked print() output format for option PF_showTreeStructure.
00259  *
00260  * Revision 1.26  2008-04-28 09:22:42  meichel
00261  * New flag DCMTypes::PF_convertToMarkup causes DcmObject::print to
00262  *   quote non-ASCII string content as XML markup
00263  *
00264  * Revision 1.25  2008-02-26 16:56:15  joergr
00265  * Added new print flag that disables the mapping of well-known UID numbers to
00266  * their associated names (e.g. transfer syntax or SOP class).
00267  *
00268  * Revision 1.24  2007/11/29 14:30:35  meichel
00269  * Updated doxygen API documentation
00270  *
00271  * Revision 1.23  2006/05/11 08:55:22  joergr
00272  * Added new option that allows to omit the element name in the XML output.
00273  *
00274  * Revision 1.22  2006/02/08 15:21:15  joergr
00275  * Removed unused type definitions.
00276  *
00277  * Revision 1.21  2005/12/08 16:28:47  meichel
00278  * Changed include path schema for all DCMTK header files
00279  *
00280  * Revision 1.20  2005/12/02 08:50:30  joergr
00281  * Added new file read mode that makes it possible to distinguish between DICOM
00282  * files, datasets and other non-DICOM files.
00283  *
00284  * Revision 1.19  2003/04/22 08:19:09  joergr
00285  * Added new command line option which allows to embed the content of the DTD
00286  * instead of referencing the DTD file.
00287  *
00288  * Revision 1.18  2003/04/01 14:57:08  joergr
00289  * Added support for XML namespaces.
00290  *
00291  * Revision 1.17  2002/12/06 12:21:00  joergr
00292  * Enhanced "print()" function by re-working the implementation and replacing
00293  * the boolean "showFullData" parameter by a more general integer flag.
00294  *
00295  * Revision 1.16  2002/11/27 12:07:23  meichel
00296  * Adapted module dcmdata to use of new header file ofstdinc.h
00297  *
00298  * Revision 1.15  2002/07/10 11:45:40  meichel
00299  * Moved definitions for Uint8, Sint8 ... Float64 from dcmdata to ofstd
00300  *   since these types are not DICOM specific
00301  *
00302  * Revision 1.14  2002/06/06 14:51:13  meichel
00303  * Corrected code for inclusion of stdlib.h
00304  *
00305  * Revision 1.13  2002/05/14 08:20:29  joergr
00306  * Added support for Base64 (MIME) encoded binary data.
00307  *
00308  * Revision 1.12  2002/04/25 10:07:13  joergr
00309  * Added support for XML output of DICOM objects.
00310  *
00311  * Revision 1.11  2001/06/01 15:48:45  meichel
00312  * Updated copyright header
00313  *
00314  * Revision 1.10  2000/03/08 16:26:19  meichel
00315  * Updated copyright header.
00316  *
00317  * Revision 1.9  2000/03/03 14:05:26  meichel
00318  * Implemented library support for redirecting error messages into memory
00319  *   instead of printing them to stdout/stderr for GUI applications.
00320  *
00321  * Revision 1.8  2000/02/07 14:44:45  meichel
00322  * The typedef for Sint8 now defaults to char instead of signed char.
00323  *   This avoids warnings on certain c-front related compilers.
00324  *   The old behaviour can be restored by compiling with the symbol
00325  *   CHAR_IS_UNSIGNED defined.
00326  *
00327  * Revision 1.7  1999/03/31 09:24:51  meichel
00328  * Updated copyright header in module dcmdata
00329  *
00330  *
00331  */


Generated on 6 Jan 2011 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.5.1