2 //-----------------------------------------------------------------------------
3 #include "gdcmDictEntry.h"
6 #include <stdio.h> // FIXME For sprintf
8 //-----------------------------------------------------------------------------
9 // Constructor / Destructor
11 * \ingroup gdcmDictEntry
13 * @param InGroup DICOM-Group Number
14 * @param InElement DICOM-Element Number
15 * @param InVr Value Representatiion
16 * @param InFourth // DO NOT use any longer;
17 * NOT part of the Dicom Standard
18 * @param InName description of the element
21 gdcmDictEntry::gdcmDictEntry(guint16 InGroup, guint16 InElement,
22 std::string InVr, std::string InFourth,
29 key = TranslateToKey(group, element);
32 //-----------------------------------------------------------------------------
35 //-----------------------------------------------------------------------------
38 * \ingroup gdcmDictEntry
39 * \brief concatenates 2 guint16 (supposed to be a Dicom group number
40 * and a Dicom element number)
41 * @param group the Dicom group number used to build the tag
42 * @param element the Dicom element number used to build the tag
43 * @return the built tag
46 TagKey gdcmDictEntry::TranslateToKey(guint16 group, guint16 element) {
49 // CLEANME: better call the iostream<< with the hex manipulator on.
50 // This requires some reading of the stdlibC++ sources to make the
51 // proper call (or copy).
52 sprintf(trash, "%04x|%04x", group , element);
53 key = trash; // Convertion through assignement
58 * \ingroup gdcmDictEntry
59 * \brief If-and only if-the V(alue) R(epresentation)
60 * \ is unset then overwrite it.
61 * @param NewVr New V(alue) R(epresentation) to be set.
63 void gdcmDictEntry::SetVR(std::string NewVr)
69 dbg.Error(true, "gdcmDictEntry::SetVR",
70 "Overwriting vr might compromise a dictionary");
74 //-----------------------------------------------------------------------------
77 //-----------------------------------------------------------------------------
80 //-----------------------------------------------------------------------------