]> Creatis software - gdcm.git/commitdiff
Oops.
authorjpr <jpr>
Mon, 17 Jan 2005 13:24:15 +0000 (13:24 +0000)
committerjpr <jpr>
Mon, 17 Jan 2005 13:24:15 +0000 (13:24 +0000)
I forgot to initilize the loop
(copy-paste from Example/PrintDicomDir was not enough)

Testing/TestDicomDir.cxx

index c778078eb4872378c0a22d7a1a4e52e8ca1dbb8f..7c4ccb3b27e5f544641d8e6577f1a4c462cd4b17 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: TestDicomDir.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/17 11:01:26 $
-  Version:   $Revision: 1.27 $
+  Date:      $Date: 2005/01/17 13:24:15 $
+  Version:   $Revision: 1.28 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -46,6 +46,7 @@ int TestDicomDir(int argc, char* argv[])
       file += "/DICOMDIR";
    }
 
+std::cout << "----------------- " << file << "-----" <<std::endl;
    e1 = new gdcm::DicomDir(file);
    if (argc > 2) 
    {
@@ -63,9 +64,15 @@ int TestDicomDir(int argc, char* argv[])
       delete e1;
       return 1;
    }
+   else
+   {
+      std::cout<<"          DicomDir '"<<file
+               <<"' is readable"<<std::endl;
+   }
 
+   e1->InitTraversal();
    // Test if the DicomDir contains any Patient
-   if( e1->GetNextEntry() )
+   if( !e1->GetNextEntry() )
    {
       std::cout<<"          DicomDir '"<<file
                <<" has no patient"<<std::endl
@@ -75,6 +82,7 @@ int TestDicomDir(int argc, char* argv[])
       return 1;
    }
 
+
   // step by step structure full exploitation
   
    std::cout << std::endl << std::endl