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