]> Creatis software - gdcm.git/blobdiff - gdcmPython/demo/test.py
* src/gdcmHeader[h, cxx] gdcmHeader now has an IsReadable predicate.
[gdcm.git] / gdcmPython / demo / test.py
index 935345c1cf4fe6ef7e034ab7b47cd545b48bb15e..fa98de2d86a4a8108a69f2b027ad399ca0b9e66e 100644 (file)
@@ -1,4 +1,5 @@
 from gdcmPython import *
+import sys
 
 ### Get filename from command line or default it
 try:
@@ -15,6 +16,10 @@ if not os.path.isfile(FileName):
 
 ### Build the header element list
 toRead = gdcmHeader(FileName)
+if not toRead.IsReadable():
+   print "The ", FileName, " file is not "
+   print "   readable with gdcm. Sorry."
+   sys.exit()
 
 print "##############################################################"
 print "### Display all the elements and their respective values"