]> Creatis software - gdcm.git/commitdiff
* src/gdcmDocEntrySet.cxx : Bug fix when getting the value
authorregrain <regrain>
Tue, 25 Jan 2005 16:32:45 +0000 (16:32 +0000)
committerregrain <regrain>
Tue, 25 Jan 2005 16:32:45 +0000 (16:32 +0000)
   * src/gdcmContentEntry.[h|cxx], gdcmValEntry.cxx : amelioration of code
   -- BeNours

ChangeLog
src/gdcmContentEntry.cxx
src/gdcmContentEntry.h
src/gdcmDocEntrySet.cxx
src/gdcmValEntry.cxx

index d3569da3b908b6259becbc17e946941f0f853860..2eb054f61547342d4ba3167873a60920a39e3696 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2005-01-25 Benoit Regrain <Benoit.Regrain@creatis.insa-lyon.fr>
+   * src/gdcmDocEntrySet.cxx : Bug fix when getting the value
+   * src/gdcmContentEntry.[h|cxx], gdcmValEntry.cxx : amelioration of code
+
 2005-01-25 Jean-Pierre Roux <jpr@creatis.univ-lyon1.fr>
    In ordrer to avoid missbehaviour :
    . gdcm::DocEntry is now specialized in
index 2e4530c3b4e7b2d5bd98d5ec16e272fcd3a3447a..3c1ed7c4ea193633014feb654431c1424dfb3e86 100644 (file)
@@ -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;
 }
 
 /**
index 95c87d243687e6576d1567c390490dfb98fea70f..b947a389637e072d52c3e0d56feb3fffb2796507 100644 (file)
@@ -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.
index 3ff3e607828479f313df832dad81e3381f1cbb8a..0616a1b699d88c8fbac4c7565381e0962c55ada2 100644 (file)
@@ -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<ContentEntry *>(GetDocEntry(group,elem));
    if( entry )
       return entry->GetValue();
    return GDCM_UNFOUND;
index ae44be0abeecc4c808f9ea0bb72c9ab50eaf46b3..03f1d679e9b85fb83f9cf63d416eb56efbe2a862 100644 (file)
@@ -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);