]> Creatis software - gdcm.git/blobdiff - gdcmPython/demo/testAll.py
* The subdirectory Data (containing all the images used for the
[gdcm.git] / gdcmPython / demo / testAll.py
index 89c045972012ce460ea15ad240628e3219cea69d..9bf4a502502a3520f3253641e890743c3c87d6aa 100644 (file)
@@ -1,3 +1,5 @@
+import glob, os
+import sys
 from gdcmPython import *
 
 # Test each file of the Data directory
@@ -26,10 +28,11 @@ AllFiles = [
        ]
 
 if __name__ == '__main__':
-       for file in AllFiles:
-               fileName = os.path.join(GDCM_DATA_PATH, file)
-               print "############## file :", fileName
-               toRead = gdcmHeader(fileName)
-               ValDict = toRead.GetPubElVal()
-               for key in ValDict.keys():
-                       print "   [%s] = [%s]" %(key, ValDict[key])
+   # AllFiles = glob.glob(os.path.join(GDCM_TEST_DATA_PATH,"*.dcm"))
+   for file in AllFiles:
+      fileName = os.path.join(GDCM_TEST_DATA_PATH, file)
+      print "############## file :", fileName
+      toRead = gdcmHeader(fileName)
+      ValDict = toRead.GetPubElVal()
+      for key in ValDict.keys():
+          print "   [%s] = [%s]" %(key, ValDict[key])