]> Creatis software - gdcm.git/blobdiff - gdcmPython/demo/testAll.py
--> Some supposed-to-be Dicom Images have no preamble.
[gdcm.git] / gdcmPython / demo / testAll.py
index 682742626c8c47d6d6247383c177827cfcd59d29..9bf4a502502a3520f3253641e890743c3c87d6aa 100644 (file)
@@ -1,7 +1,8 @@
-from load import *
+import glob, os
+import sys
+from gdcmPython import *
 
-# Where all the test images are
-TestFileDir =  os.path.join("..", "..", "Data")
+# Test each file of the Data directory
 
 AllFiles = [
        "CR-MONO1-10-chest.dcm",
@@ -27,12 +28,11 @@ AllFiles = [
        ]
 
 if __name__ == '__main__':
-       for file in AllFiles:
-               fileName = os.path.join(TestFileDir, file)
-               print "############## file :", fileName
-               toRead = gdcm.gdcmHeader(fileName)
-               toRead.LoadElements()
-               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])