X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=src%2FgdcmDictEntry.cxx;h=c9b1ca0c687943e563402b8ce861d2818e3257f3;hb=deba96a5f8b1fb7ce4fd411cd3f13872f5437813;hp=5bcacb34fbe1960b1d907bdef4eec08229a56372;hpb=70e24c6c61481f9836e26b6b44a9670d92a4f43b;p=gdcm.git diff --git a/src/gdcmDictEntry.cxx b/src/gdcmDictEntry.cxx index 5bcacb34..c9b1ca0c 100644 --- a/src/gdcmDictEntry.cxx +++ b/src/gdcmDictEntry.cxx @@ -1,4 +1,7 @@ -#include "gdcmlib.h" +// gdcmDict.cxx + +#include "gdcm.h" +#include "gdcmUtil.h" gdcmDictEntry::gdcmDictEntry(guint16 InGroup, guint16 InElement, string InVr, string InFourth, string InName) @@ -21,3 +24,23 @@ TagKey gdcmDictEntry::TranslateToKey(guint16 group, guint16 element) { key = trash; // Convertion through assignement return key; } + +/** + * \ingroup gdcmDictEntry + * \brief If-and only if-the vr is unset then overwrite it. + * @param NewVr New vr to be set. + */ +void gdcmDictEntry::SetVR(string NewVr) { + if ( IsVrUnknown() ) + vr = NewVr; + else { + dbg.Error(true, "gdcmDictEntry::SetVR", + "Overwriting vr might compromise a dictionary"); + } +} + +bool gdcmDictEntry::IsVrUnknown() { + if ( vr == "Unknown" ) + return true; + return false; +}