00001
00002
00003 #include "gdcmDictEntry.h"
00004
00005 #include <stdio.h>
00006 #include "gdcmUtil.h"
00007
00008
00009
00021 gdcmDictEntry::gdcmDictEntry(guint16 InGroup, guint16 InElement,
00022 std::string InVr, std::string InFourth,
00023 std::string InName) {
00024 group = InGroup;
00025 element = InElement;
00026 vr = InVr;
00027 fourth = InFourth;
00028 name = InName;
00029 key = TranslateToKey(group, element);
00030 }
00031
00032
00033
00034
00035
00036
00046 TagKey gdcmDictEntry::TranslateToKey(guint16 group, guint16 element) {
00047 char trash[10];
00048 TagKey key;
00049
00050
00051
00052 sprintf(trash, "%04x|%04x", group , element);
00053 key = trash;
00054 return key;
00055 }
00056
00063 void gdcmDictEntry::SetVR(std::string NewVr)
00064 {
00065 if ( IsVRUnknown() )
00066 vr = NewVr;
00067 else
00068 {
00069 dbg.Error(true, "gdcmDictEntry::SetVR",
00070 "Overwriting vr might compromise a dictionary");
00071 }
00072 }
00073
00074
00075
00076
00077
00078
00079
00080
00081