1 /*=========================================================================
4 Module: $RCSfile: gdcmDictEntry.cxx,v $
6 Date: $Date: 2005/01/07 22:06:47 $
7 Version: $Revision: 1.37 $
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 Representation
33 * @param vm Value Mutlplicity
34 * @param name description of the element
37 DictEntry::DictEntry(uint16_t group, uint16_t element,
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 return Util::Format("%04x|%04x", group, element);
67 //-----------------------------------------------------------------------------
69 * \brief If-and only if-the V(alue) R(epresentation)
70 * \ is unset then overwrite it.
71 * @param vr New V(alue) R(epresentation) to be set.
73 void DictEntry::SetVR(TagName const &vr)
81 gdcmErrorMacro( "Overwriting VR might compromise a dictionary");
85 //-----------------------------------------------------------------------------
87 * \brief If-and only if-the V(alue) M(ultiplicity)
88 * \ is unset then overwrite it.
89 * @param vr New V(alue) M(ultiplicity) to be set.
91 void DictEntry::SetVM(TagName const &vm)
99 gdcmErrorMacro( "Overwriting VM might compromise a dictionary");
102 //-----------------------------------------------------------------------------
105 //-----------------------------------------------------------------------------
108 //-----------------------------------------------------------------------------
109 } // end namespace gdcm