X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmDictEntry.cxx;h=b74c9fdb5db21639ef0e1384038a69202f6e1d46;hb=2f88e766a552cc0d0a6bf009bc26dea6a872c148;hp=77590de3758fb5c0fdc399f947a7d2c6a73e9b36;hpb=40b909789581894e57a0d8f22d6f1f91f55e7f84;p=gdcm.git diff --git a/src/gdcmDictEntry.cxx b/src/gdcmDictEntry.cxx index 77590de3..b74c9fdb 100644 --- a/src/gdcmDictEntry.cxx +++ b/src/gdcmDictEntry.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDictEntry.cxx,v $ Language: C++ - Date: $Date: 2004/10/18 02:35:35 $ - Version: $Revision: 1.28 $ + Date: $Date: 2005/01/07 22:06:47 $ + Version: $Revision: 1.37 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -29,20 +29,20 @@ namespace gdcm * \brief Constructor * @param group DICOM-Group Number * @param element DICOM-Element Number - * @param vr Value Representatiion - * @param fourth // DO NOT use any longer; - * NOT part of the Dicom Standard + * @param vr Value Representation + * @param vm Value Mutlplicity * @param name description of the element */ DictEntry::DictEntry(uint16_t group, uint16_t element, - TagName const & vr, TagName const & fourth, - TagName const & name) + TagName const &vr, + TagName const &vm, + TagName const &name) { Group = group; Element = element; VR = vr; - Fourth = fourth; + VM = vm; Name = name; Key = TranslateToKey(group, element); } @@ -61,9 +61,7 @@ DictEntry::DictEntry(uint16_t group, uint16_t element, */ TagKey DictEntry::TranslateToKey(uint16_t group, uint16_t element) { - TagKey key = Util::Format("%04x|%04x", group , element); - - return key; + return Util::Format("%04x|%04x", group, element); } //----------------------------------------------------------------------------- @@ -72,7 +70,7 @@ TagKey DictEntry::TranslateToKey(uint16_t group, uint16_t element) * \ is unset then overwrite it. * @param vr New V(alue) R(epresentation) to be set. */ -void DictEntry::SetVR(TagName const & vr) +void DictEntry::SetVR(TagName const &vr) { if ( IsVRUnknown() ) { @@ -80,11 +78,27 @@ void DictEntry::SetVR(TagName const & vr) } else { - dbg.Error(true, "DictEntry::SetVR", - "Overwriting VR might compromise a dictionary"); + gdcmErrorMacro( "Overwriting VR might compromise a dictionary"); } } +//----------------------------------------------------------------------------- +/** + * \brief If-and only if-the V(alue) M(ultiplicity) + * \ is unset then overwrite it. + * @param vr New V(alue) M(ultiplicity) to be set. + */ +void DictEntry::SetVM(TagName const &vm) +{ + if ( IsVMUnknown() ) + { + VM = vm; + } + else + { + gdcmErrorMacro( "Overwriting VM might compromise a dictionary"); + } +} //----------------------------------------------------------------------------- // Protected