]> Creatis software - gdcm.git/blobdiff - Testing/TestBuildUpDicomDir.cxx
add std::string Orientation::GetOrientation ( File *f ) method, that
[gdcm.git] / Testing / TestBuildUpDicomDir.cxx
index f191a9c8d08bb84f46532a26ddfac286aab005ba..524e583730cb812bcf179dbb8830d99da03b1831 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: TestBuildUpDicomDir.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/02/02 10:41:10 $
-  Version:   $Revision: 1.1 $
+  Date:      $Date: 2005/08/31 09:29:11 $
+  Version:   $Revision: 1.4 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -181,11 +181,13 @@ int TestBuildUpDicomDir(int argc, char *argv[])
    dcmdir->Print();
 
    // Write it on disc
-   dcmdir->WriteDicomDir("NewDICOMDIR");
+   dcmdir->Write("NewDICOMDIR");
    delete dcmdir;
 
    // Read the newly written DicomDir
-   gdcm::DicomDir *newDicomDir = new gdcm::DicomDir("NewDICOMDIR");
+   gdcm::DicomDir *newDicomDir = new gdcm::DicomDir();
+   newDicomDir->SetFileName("NewDICOMDIR");
+   newDicomDir->Load( );
    if( !newDicomDir->IsReadable() )
    {
       std::cout<<"          Written DicomDir 'NewDICOMDIR'"
@@ -259,7 +261,7 @@ int TestBuildUpDicomDir(int argc, char *argv[])
       std::cout << "Pysician : [" 
                 << valueStuff
                 << "]" << std::endl;
-      if ( !(s12 = p1->GetNextStudy()) )
+      if ( (s12 = p1->GetNextStudy()) == 0 )
       {
          errorFound = true;
          break;
@@ -290,7 +292,7 @@ int TestBuildUpDicomDir(int argc, char *argv[])
                 << s12->GetEntryValue(0x0008,0x1060)
                 << "]" << std::endl;
 
-      if ( !(s13 = p1->GetNextStudy()) )
+      if ( (s13 = p1->GetNextStudy()) == 0 )
       {
          std::cout << "Study StudyDescrOne.Tree missing" << std::endl;
          break;
@@ -317,7 +319,7 @@ int TestBuildUpDicomDir(int argc, char *argv[])
                 << valueStuff
                 << "]" << std::endl;
 
-      if (!(s111 = s11->GetFirstSerie()) )
+      if ((s111 = s11->GetFirstSerie()) == 0 )
       {
          std::cout << "Serie 01-01-111 missing" << std::endl;
          errorFound = true;
@@ -337,7 +339,7 @@ int TestBuildUpDicomDir(int argc, char *argv[])
                 << valueStuff
                 << "]" << std::endl;
 
-      if ( !(s1111 = s111->GetFirstImage()) )
+      if ( (s1111 = s111->GetFirstImage()) == 0 )
       {
          std::cout << "missing image S1111" << std::endl;
          errorFound = true;
@@ -350,7 +352,7 @@ int TestBuildUpDicomDir(int argc, char *argv[])
          break;
       }
 */
-      if ( !(s1112 = s111->GetNextImage()) )
+      if ( (s1112 = s111->GetNextImage()) == 0 )
       {
          std::cout << "missing image S1112" << std::endl;
          errorFound = true;