]> Creatis software - gdcm.git/commitdiff
To allow testsuite go on.
authorjpr <jpr>
Thu, 12 Apr 2007 13:06:02 +0000 (13:06 +0000)
committerjpr <jpr>
Thu, 12 Apr 2007 13:06:02 +0000 (13:06 +0000)
Testing/TestBuildUpDicomDir.cxx
Testing/TestDicomDir.cxx
src/gdcmDicomDir.cxx

index a30c88c5008b6c8ddd1575fb2f3ad899f9701d88..5eafdbe838dce3939f8b95f80735c31f34dd44b3 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: TestBuildUpDicomDir.cxx,v $
   Language:  C++
-  Date:      $Date: 2006/04/11 16:05:03 $
-  Version:   $Revision: 1.9 $
+  Date:      $Date: 2007/04/12 13:06:02 $
+  Version:   $Revision: 1.10 $
                                                                                 
   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 @@ int TestBuildUpDicomDir(int argc, char *argv[])
       std::cerr << "Usage: " << argv[0] << " dummy " << std::endl;
    }
    
- //gdcm::Debug::DebugOn();
+ // gdcm::Debug::DebugOn();
  
    bool errorFound = false; 
    gdcm::DicomDir *dcmdir;
@@ -49,6 +49,7 @@ int TestBuildUpDicomDir(int argc, char *argv[])
    dcmdir = gdcm::DicomDir::New();
 
    gdcm::DicomDirPatient *p1;
+   
    // --- Forget these 4 lines :
    // just to improve test coverage.
    p1=dcmdir->GetFirstPatient();
@@ -116,7 +117,6 @@ int TestBuildUpDicomDir(int argc, char *argv[])
    // Let's create and add a Image for this Serie
    s1111 = s111->NewImage();
    s1111->SetEntryString("imageFileName1111",0x0004,0x1500);
-
    gdcm::DicomDirImage *s1112 = s111->NewImage();
    s1112->SetEntryString("imageFileName1112",0x0004,0x1500);
 
@@ -161,11 +161,23 @@ int TestBuildUpDicomDir(int argc, char *argv[])
    // Print
    std::cout << "Test/BuildUpDicomDir: Test Print of patients\n";
    p1->Print();
-   std::cout << "Test/BuildUpDicomDir: -------------------\n";
+   std::cout << "Test/BuildUpDicomDir: end of P1-------------------\n";
    p2->Print();
-   std::cout << "Test/BuildUpDicomDir: -------------------\n";
+   std::cout << "Test/BuildUpDicomDir: end of P2-------------------\n";
    p3->Print();
+   std::cout << "Test/BuildUpDicomDir: end of P3-------------------\n";   
    std::cout << "Test/BuildUpDicomDir: Test Print of patients ended\n";
+   
+ // Let's loop on Patients.  
+   gdcm::DicomDirPatient *p;
+   p=dcmdir->GetFirstPatient();
+   while (p) {
+      std::cout << "one more patient\n";
+      p->Print();
+      p=dcmdir->GetNextPatient();
+   }
+
   
    if( !dcmdir->IsReadable() )
    {
index 478ed7588db1d80a1b55f38dc37076b977127e03..5690f519dfdd3f6644e5608bde555b476b96a54e 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: TestDicomDir.cxx,v $
   Language:  C++
-  Date:      $Date: 2007/03/23 15:03:01 $
-  Version:   $Revision: 1.44 $
+  Date:      $Date: 2007/04/12 13:06:02 $
+  Version:   $Revision: 1.45 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -105,6 +105,9 @@ int TestDicomDir(int argc, char *argv[])
       file += "/DICOMDIR";
    }
 
+   std::cout << "DicomDir we're going to deal with : ["<< file << "]" 
+             << std::endl;
+
    dicomdir = gdcm::DicomDir::New();
    dicomdir->SetFileName(file);
    dicomdir->Load();
@@ -178,12 +181,22 @@ int TestDicomDir(int argc, char *argv[])
       pa1 = dicomdir->GetNextPatient();
    }  
 
+/*
+// this one is *really* too much verbose!
+
    std::cout << std::endl << std::endl  
              << " = DICOMDIR full content ====================================" 
              << std::endl<< std::endl;
-  // dicomdir->Print();
-
+   dicomdir->Print();
+   std::cout << std::endl << std::endl  
+             << " = end of DICOMDIR full content ====================================" 
+             << std::endl<< std::endl;
+*/
    // ------------------------- second stage ---------------------------
+ gdcm::Debug::DebugOn();
     
    // Write on disc what we read
    dicomdir->Write("NewDICOMDIR");
index 3bb587188b2833903582e8c809f0412fb0ded67f..dae78e85c9b8ce7bf142022c085583c518bea0b9 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDir.cxx,v $
   Language:  C++
-  Date:      $Date: 2007/04/12 10:43:42 $
-  Version:   $Revision: 1.191 $
+  Date:      $Date: 2007/04/12 13:06:03 $
+  Version:   $Revision: 1.192 $
   
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -127,7 +127,7 @@ DicomDir::DicomDir()
 {
    Initialize();  // sets all private fields to NULL
    ParseDir = false;
-   // NewMeta();
+   NewMeta();
 }
 
 //#ifndef GDCM_LEGACY_REMOVE
@@ -252,7 +252,6 @@ bool DicomDir::DoTheLoadingJob( )
       }
       else
       {
-         NewMeta();
          CreateDicomDir();
       }
    }