]> Creatis software - gdcm.git/commitdiff
BUG: 1-n VM was not handle properly
authormalaterre <malaterre>
Fri, 21 Oct 2005 15:16:52 +0000 (15:16 +0000)
committermalaterre <malaterre>
Fri, 21 Oct 2005 15:16:52 +0000 (15:16 +0000)
src/gdcmDataEntry.cxx

index cf6a3689d36bf28cdaa8aaf350a2a0d22b2fb0a5..6c59d8e90375b877be74e3ce9c660d08bcd3ff76 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDataEntry.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/10/21 14:15:41 $
-  Version:   $Revision: 1.6 $
+  Date:      $Date: 2005/10/21 15:16:52 $
+  Version:   $Revision: 1.7 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -221,11 +221,22 @@ double DataEntry::GetValue(const uint32_t &id) const
 
 bool DataEntry::IsValueCountValid() const
 {
+  bool valid = false;
   uint32_t vm;
-  std::istringstream os;
-  os.str( GetVM() );
-  os >> vm;
-  return vm == GetValueCount();
+  const std::string &strVM = GetVM();
+  if( strVM == "1-n" )
+    {
+    // make sure it is at least one ??? FIXME
+    valid = GetValueCount() >= 1;
+    }
+  else
+    {
+    std::istringstream os;
+    os.str( strVM );
+    os >> vm;
+    valid = vm == GetValueCount();
+    }
+  return valid;
 }
 
 uint32_t DataEntry::GetValueCount(void) const