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