1 /*=========================================================================
4 Module: $RCSfile: gdcmDictEntry.cxx,v $
6 Date: $Date: 2004/10/18 02:35: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 "gdcmDictEntry.h"
20 #include "gdcmDebug.h"
26 //-----------------------------------------------------------------------------
27 // Constructor / Destructor
30 * @param group DICOM-Group Number
31 * @param element DICOM-Element Number
32 * @param vr Value Representatiion
33 * @param fourth // DO NOT use any longer;
34 * NOT part of the Dicom Standard
35 * @param name description of the element
38 DictEntry::DictEntry(uint16_t group, uint16_t element,
39 TagName const & vr, TagName const & fourth,
47 Key = TranslateToKey(group, element);
50 //-----------------------------------------------------------------------------
53 //-----------------------------------------------------------------------------
56 * \brief concatenates 2 uint16_t (supposed to be a Dicom group number
57 * and a Dicom element number)
58 * @param group the Dicom group number used to build the tag
59 * @param element the Dicom element number used to build the tag
60 * @return the built tag
62 TagKey DictEntry::TranslateToKey(uint16_t group, uint16_t element)
64 TagKey key = Util::Format("%04x|%04x", group , element);
69 //-----------------------------------------------------------------------------
71 * \brief If-and only if-the V(alue) R(epresentation)
72 * \ is unset then overwrite it.
73 * @param vr New V(alue) R(epresentation) to be set.
75 void DictEntry::SetVR(TagName const & vr)
83 dbg.Error(true, "DictEntry::SetVR",
84 "Overwriting VR might compromise a dictionary");
88 //-----------------------------------------------------------------------------
91 //-----------------------------------------------------------------------------
94 //-----------------------------------------------------------------------------
95 } // end namespace gdcm