]> Creatis software - gdcm.git/commitdiff
Add some comments for better understanding the gdcm::LD_NOSHADOW,
authorjpr <jpr>
Sun, 23 Oct 2005 14:53:51 +0000 (14:53 +0000)
committerjpr <jpr>
Sun, 23 Oct 2005 14:53:51 +0000 (14:53 +0000)
 gdcm::LD_NOSEQ options.

Testing/TestAllVM.cxx

index e0181e9cfb705ab29757085281ad7a9391bc9a9a..1dce8206204ea1a16d8749ad6ea56ba45a726ab6 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: TestAllVM.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/10/21 16:32:10 $
-  Version:   $Revision: 1.6 $
+  Date:      $Date: 2005/10/23 14:53:51 $
+  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
 
 int DoTheVMTest(std::string const &filename)
 {
-      gdcm::File file;
-      // - Do not test unknow VM in shadow groups (in element 0x0000 is present
-      // - Skip Sequences (if they are 'True Length'); loading will be quicker
-      //                  (anyway, Sequences are skipped at processing time ...)
-      file.SetLoadMode( gdcm::LD_NOSHADOW | gdcm::LD_NOSEQ );
+   gdcm::File file;
+   // - Do not test unknow VM in shadow groups (if element 0x0000 is present)
+   // - Skip Sequences (if they are 'True Length'); loading will be quicker
+   //                  (anyway, Sequences are skipped at processing time ...)
+   file.SetLoadMode( gdcm::LD_NOSHADOW | gdcm::LD_NOSEQ );
 
-      file.SetFileName( filename );
-      if( !file.Load() ) //would be really bad...
-        return 1;
+   file.SetFileName( filename );
+   if( !file.Load() ) //would be really bad...
+      return 1;
 
-      gdcm::DocEntry *d = file.GetFirstEntry();
-      std::cerr << "Testing file : " << filename << std::endl;
-      while(d)
+   gdcm::DocEntry *d = file.GetFirstEntry();
+   std::cerr << "Testing file : " << filename << std::endl;
+   while(d)
+   {
+      if ( gdcm::DataEntry *de = dynamic_cast<gdcm::DataEntry *>(d) )
       {
-         if ( gdcm::DataEntry *de = dynamic_cast<gdcm::DataEntry *>(d) )
-         {
-           if( !de->IsValueCountValid() )
-             {
-             std::cerr << "Element: " << de->GetKey() <<
-               " (" << de->GetName() << ") " <<
-               "Contains a wrong VM: " << de->GetValueCount() 
-               << " should be: " << de->GetVM() << std::endl;;
-             }
+         if ( !(de->GetGroup() % 2) ) // Don't check shadow elements. Righ now,
+                                      // Private Dictionnary are not dealt with
+         {    
+            if( !de->IsValueCountValid() )
+            {
+               std::cerr << "Element: " << de->GetKey() <<
+                    " (" << de->GetName() << ") " <<
+                    "Contains a wrong VM: " << de->GetValueCount() 
+                    << " should be: " << de->GetVM() << std::endl;;
+            }
          }
-         else
-         {
+      }
+      else
+      {
           // We skip pb of SQ recursive exploration
-         }
-
-         d = file.GetNextEntry();
       }
-
+      d = file.GetNextEntry();
+   }
       return 0;
 }