From: regrain Date: Tue, 25 Jan 2005 16:32:45 +0000 (+0000) Subject: * src/gdcmDocEntrySet.cxx : Bug fix when getting the value X-Git-Tag: Version1.0.bp~189 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=2919038a10834b08a8ab3f168d14511721a007cd;p=gdcm.git * src/gdcmDocEntrySet.cxx : Bug fix when getting the value * src/gdcmContentEntry.[h|cxx], gdcmValEntry.cxx : amelioration of code -- BeNours --- diff --git a/ChangeLog b/ChangeLog index d3569da3..2eb054f6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2005-01-25 Benoit Regrain + * src/gdcmDocEntrySet.cxx : Bug fix when getting the value + * src/gdcmContentEntry.[h|cxx], gdcmValEntry.cxx : amelioration of code + 2005-01-25 Jean-Pierre Roux In ordrer to avoid missbehaviour : . gdcm::DocEntry is now specialized in diff --git a/src/gdcmContentEntry.cxx b/src/gdcmContentEntry.cxx index 2e4530c3..3c1ed7c4 100644 --- a/src/gdcmContentEntry.cxx +++ b/src/gdcmContentEntry.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmContentEntry.cxx,v $ Language: C++ - Date: $Date: 2005/01/25 15:21:20 $ - Version: $Revision: 1.1 $ + Date: $Date: 2005/01/25 16:32:45 $ + Version: $Revision: 1.2 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -39,6 +39,7 @@ namespace gdcm */ ContentEntry::ContentEntry(DictEntry *e) : DocEntry(e) { + Value = GDCM_UNFOUND; } /** diff --git a/src/gdcmContentEntry.h b/src/gdcmContentEntry.h index 95c87d24..b947a389 100644 --- a/src/gdcmContentEntry.h +++ b/src/gdcmContentEntry.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmContentEntry.h,v $ Language: C++ - Date: $Date: 2005/01/25 15:21:20 $ - Version: $Revision: 1.1 $ + Date: $Date: 2005/01/25 16:32:45 $ + Version: $Revision: 1.2 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -43,23 +43,19 @@ public: /// Sets the value (string) of the current Dicom entry virtual void SetValue(std::string const &val) { Value = val; }; - void SetValueOnly(std::string const &val) { Value = val; }; - /// \brief Returns the 'Value' (e.g. "Dupond Marcel") converted /// into a 'string', event if it's physically stored on disk as an integer std::string const &GetValue() const { return Value; }; protected: - // Contructors are protected, not to be invoked by end user. ContentEntry(DictEntry *e); ContentEntry(DocEntry *d); // Destructor is protected, not to be invoked by end user. ~ContentEntry(); - + private: // Members : - /// \brief Dicom entry value, internaly represented as a std::string. /// The Value Representation (\ref VR) is independently used /// in order to interpret (decode) this field. diff --git a/src/gdcmDocEntrySet.cxx b/src/gdcmDocEntrySet.cxx index 3ff3e607..0616a1b6 100644 --- a/src/gdcmDocEntrySet.cxx +++ b/src/gdcmDocEntrySet.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDocEntrySet.cxx,v $ Language: C++ - Date: $Date: 2005/01/25 15:44:23 $ - Version: $Revision: 1.45 $ + Date: $Date: 2005/01/25 16:32:45 $ + Version: $Revision: 1.46 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -40,7 +40,7 @@ namespace gdcm */ std::string DocEntrySet::GetEntryValue(uint16_t group, uint16_t elem) { - ValEntry *entry = GetValEntry(group,elem); + ContentEntry *entry = dynamic_cast(GetDocEntry(group,elem)); if( entry ) return entry->GetValue(); return GDCM_UNFOUND; diff --git a/src/gdcmValEntry.cxx b/src/gdcmValEntry.cxx index ae44be0a..03f1d679 100644 --- a/src/gdcmValEntry.cxx +++ b/src/gdcmValEntry.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmValEntry.cxx,v $ Language: C++ - Date: $Date: 2005/01/25 15:21:20 $ - Version: $Revision: 1.51 $ + Date: $Date: 2005/01/25 16:32:45 $ + Version: $Revision: 1.52 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -192,13 +192,13 @@ void ValEntry::SetValue(std::string const &val) { // for multivaluated items l = (Util::CountSubstring(val, "\\") + 1) * 2; - SetValueOnly(val); + ContentEntry::SetValue(val); } else if( vr == "UL" || vr == "SL" ) { // for multivaluated items l = (Util::CountSubstring(val, "\\") + 1) * 4;; - SetValueOnly(val); + ContentEntry::SetValue(val); } else { @@ -206,7 +206,7 @@ void ValEntry::SetValue(std::string const &val) gdcmAssertMacro( !(finalVal.size() % 2) ); l = finalVal.length(); - SetValueOnly(finalVal); + ContentEntry::SetValue(finalVal); } } else @@ -215,7 +215,7 @@ void ValEntry::SetValue(std::string const &val) gdcmAssertMacro( !(finalVal.size() % 2) ); l = finalVal.length(); - SetValueOnly(finalVal); + ContentEntry::SetValue(finalVal); } SetLength(l);