]> Creatis software - gdcm.git/blobdiff - Testing/TestMakeDicomDir.cxx
#Something stupid occured in the code for LibIDO images.
[gdcm.git] / Testing / TestMakeDicomDir.cxx
index f73b0e49ad2c795537d38235de4ead2aee633c9e..861b755348c1ed16ece531dc2009f6afc66c9bde 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: TestMakeDicomDir.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/02/02 10:41:10 $
-  Version:   $Revision: 1.1 $
+  Date:      $Date: 2005/06/02 09:37:50 $
+  Version:   $Revision: 1.3 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -47,7 +47,7 @@ void EndMethod(void *endMethod)
 
 int TestMakeDicomDir(int argc, char *argv[])
 {
-//   gdcm::Debug::DebugOn();
+   //gdcm::Debug::DebugOn();
    std::string dirName;   
 
    if (argc > 1)
@@ -58,9 +58,21 @@ int TestMakeDicomDir(int argc, char *argv[])
    {
       dirName = GDCM_DATA_ROOT;
    }
+   gdcm::DicomDir *dcmdir;
+    // Old style (still available)
+    //
+    // true : we ask for Directory parsing
+    // dcmdir = new gdcm::DicomDir(dirName, true);
 
-    // we ask for Directory parsing
-    gdcm::DicomDir *dcmdir = new gdcm::DicomDir(dirName, true);
+   // new style (user is allowed no to load Sequences an/or Shadow Groups)
+   dcmdir = new gdcm::DicomDir( );
+   dcmdir->SetParseDir(true);
+   // dcmdir->SetLoadMode(NO_SEQ | NO_SHADOW);
+   // some images have a wrong length for element 0x0000 of private groups
+   dcmdir->SetLoadMode(NO_SEQ);
+   dcmdir->Load(dirName);
 
    dcmdir->SetStartMethod(StartMethod, (void *) NULL);
    dcmdir->SetEndMethod(EndMethod);
@@ -101,7 +113,6 @@ int TestMakeDicomDir(int argc, char *argv[])
    }
 
    std::cout<<std::flush;
-
    delete newDicomDir;
    return 0;
 }