1 /*=========================================================================
4 Module: $RCSfile: gdcmGlobal.cxx,v $
6 Date: $Date: 2005/10/25 14:52:35 $
7 Version: $Revision: 1.28 $
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 =========================================================================*/
19 #include "gdcmGlobal.h"
21 #include "gdcmDebug.h"
24 #include "gdcmDictGroupName.h"
25 #include "gdcmDictSet.h"
26 #include "gdcmDicomDirElement.h"
30 //-----------------------------------------------------------------------------
31 /// \brief Those global string that are returned by reference everywhere in
32 /// gdcm code used to be in gdcmCommon.h but due to a 'bug' in gcc/MacOSX
33 /// you cannot have static initialization in a multithreaded environment
34 /// since there is a lazy construction everything got skrew up somehow
35 /// Therefore the actual initialization is done in a cxx file (avoid
36 /// duplicated symbol), and an extern is used in gdcmCommon.h
38 const std::string GDCM_UNKNOWN = "gdcm::Unknown";
39 const std::string GDCM_UNFOUND = "gdcm::Unfound";
40 const std::string GDCM_BINLOADED = "gdcm::Binary data loaded";
41 const std::string GDCM_NOTLOADED = "gdcm::NotLoaded";
42 const std::string GDCM_UNREAD = "gdcm::UnRead";
43 const std::string GDCM_NOTASCII = "gdcm::NotAscii";
44 const std::string GDCM_PIXELDATA = "gdcm::Pixel Data to be loaded";
46 const std::string GDCM_VRUNKNOWN = " ";
48 //-----------------------------------------------------------------------------
49 DictSet *Global::Dicts = (DictSet *)0;
50 VR *Global::ValRes = (VR *)0;
51 TS *Global::TranSyn = (TS *)0;
52 DictGroupName *Global::GroupName = (DictGroupName *)0;
53 DicomDirElement *Global::ddElem = (DicomDirElement *)0;
55 //-----------------------------------------------------------------------------
57 * \brief Global container
61 //-------------------------------------------------------------------------
62 // Constructor / Destructor
64 * \brief constructor : populates the various H Tables
68 if (ValRes || TranSyn || Dicts || ddElem)
70 gdcmWarningMacro( "VR or TS or Dicts already allocated");
73 Dicts = DictSet::New();
76 GroupName = DictGroupName::New();
77 ddElem = DicomDirElement::New();
81 * \brief canonical destructor
92 //-----------------------------------------------------------------------------
95 * \brief returns a pointer to Dictionaries Table
97 DictSet *Global::GetDicts()
103 * \brief returns a pointer to the 'Value Representation Table'
111 * \brief returns a pointer to the 'Transfer Syntax Table'
119 * \brief returns a pointer to the Group name correspondance table
121 DictGroupName *Global::GetDictGroupName()
127 * \brief returns a pointer to the DicomDir related elements Table
129 DicomDirElement *Global::GetDicomDirElements()
134 //-----------------------------------------------------------------------------
137 //-----------------------------------------------------------------------------
140 //-----------------------------------------------------------------------------
143 //-----------------------------------------------------------------------------
144 } // end namespace gdcm