]> Creatis software - gdcm.git/blobdiff - Testing/TestDicomDir.cxx
test
[gdcm.git] / Testing / TestDicomDir.cxx
index e47753c9243ac9cc43f94b0a113c42f80054d156..1cccb798bd5a265cf6f6685c54c9eb1b4a29f2c7 100644 (file)
@@ -16,9 +16,8 @@
 #define  ostringstream ostrstream
 //extern "C"
 
-using namespace std;
 
-int main(int argc, char* argv[])
+int testDicomDir(int argc, char* argv[])
 {  
    gdcmDicomDir *e1;
    ListTag::iterator deb , fin;
@@ -32,9 +31,11 @@ int main(int argc, char* argv[])
    std::string file; 
    if (argc > 1) 
       file = argv[1];    
-   else        
-      file = "../gdcmData/DICOMDIR";
-      
+   else {
+      file += GDCM_DATA_ROOT;
+      file += "/DICOMDIR";
+    }
+
    e1 = new gdcmDicomDir(file.c_str());
        if (argc > 2) {
           int level = atoi(argv[2]);   
@@ -80,7 +81,7 @@ int main(int argc, char* argv[])
    }   
  */
  
-   cout << std::endl << std::endl  
+   std::cout << std::endl << std::endl  
             << " = Liste des PATIENT/STUDY/SERIE ==========================================" 
             << std::endl<< std::endl;  
  
@@ -136,7 +137,7 @@ int main(int argc, char* argv[])
    }   
  */  
 
-   cout << std::endl << std::endl  
+   std::cout << std::endl << std::endl  
         << " = Contenu Complet du DICOMDIR ==========================================" 
         << std::endl<< std::endl;      
    e1->Print();