1 /*=========================================================================
4 Module: $RCSfile: gdcmCommon.h,v $
6 Date: $Date: 2005/10/23 15:32:30 $
7 Version: $Revision: 1.101 $
9 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10 l'Image). All rights reserved. See Doc/License.txt or
11 http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
13 This software is distributed WITHOUT ANY WARRANTY; without even
14 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 PURPOSE. See the above copyright notices for more information.
17 =========================================================================*/
22 #include "gdcmConfigure.h"
23 #include "gdcmSystem.h"
24 #include "gdcmMacro.h"
28 //-----------------------------------------------------------------------------
29 #if defined(_WIN32) && defined(BUILD_SHARED_LIBS)
31 #define GDCM_EXPORT __declspec( dllexport )
33 #define GDCM_EXPORT __declspec( dllimport )
39 //-----------------------------------------------------------------------------
40 /// \brief namespace for Grass root DiCoM
44 // Centralize information about the gdcm dictionary in only one file:
46 # define PUB_DICT_PATH "../Dicts/"
48 #define PUB_DICT_NAME "DicomV3Dict"
49 #define PUB_DICT_FILENAME "gdcm.dic"
50 #define DICT_ELEM "DicomDir.dic"
51 #define DICT_TS "dicomTS.dic"
52 #define DICT_VR "dicomVR.dic"
53 #define DICT_GROUP_NAME "DictGroupName.dic"
55 GDCM_EXPORT extern const std::string GDCM_UNKNOWN;
56 GDCM_EXPORT extern const std::string GDCM_UNFOUND;
57 GDCM_EXPORT extern const std::string GDCM_BINLOADED;
58 GDCM_EXPORT extern const std::string GDCM_NOTLOADED;
59 GDCM_EXPORT extern const std::string GDCM_UNREAD;
60 GDCM_EXPORT extern const std::string GDCM_NOTASCII;
61 GDCM_EXPORT extern const std::string GDCM_PIXELDATA;
63 GDCM_EXPORT extern const std::string GDCM_VRUNKNOWN;
65 /// \brief TagKey is made to hold the standard Dicom Tag
66 /// (Group number, Element number)
67 /// Instead of using the two '16 bits integers' as the Hask Table key, we
68 /// converted into a string (e.g. 0x0018,0x0050 converted into "0018|0050")
69 /// It appears to be a huge waste of time.
70 /// We'll fix the mess up -without any change in the API- as soon as the bench
71 /// marks are fully performed.
73 #if defined(_MSC_VER) && (_MSC_VER == 1200)
74 // Doing everything within gdcm namespace to avoid polluting 3d party software
75 inline std::ostream& operator<<(std::ostream& _O, std::string _val)
77 return _O << _val.c_str();
81 /// \brief TagName is made to hold the 'non hexa" fields (VR, VM, Name)
83 typedef std::string TagName;
85 /// \brief various types of a DICOM file (for internal use only)
88 ExplicitVR, // DicomDir is in this case. Except when it's ImplicitVR !...
95 /// \brief type of the elements composing a DICOMDIR (for internal use only)
106 /// \brief comparison operators (as used in SerieHelper::AddRestriction() )
116 /// \brief Loading mode
119 LD_ALL = 0x00000000, // Load all
120 LD_NOSEQ = 0x00000001, // Don't load Sequences
121 LD_NOSHADOW = 0x00000002, // Don't load odd groups
122 LD_NOSHADOWSEQ = 0x00000004 // Don't load Sequences if they belong
124 // (*exclusive* from LD_NOSEQ and LD_NOSHADOW)
128 * \brief structure, for internal use only
132 /// Dicom Group number
133 unsigned short int Group;
134 /// Dicom Element number
135 unsigned short int Elem;
136 /// value (coded as a std::string) of the Element
141 //-----------------------------------------------------------------------------