]> Creatis software - gdcm.git/blobdiff - gdcmPython/demo/PrintHeader.py.in
* Add the PrintDicomDir test
[gdcm.git] / gdcmPython / demo / PrintHeader.py.in
index affa5f48425eb95bf2d65706ec7b75a9a672f08a..cd9acfb849c735b4f0f033f170955355e130e0c9 100644 (file)
@@ -21,19 +21,11 @@ try:
 except IndexError:
    printLevel = 1
 
-#if not os.path.isfile(FileName):
-#   print "Cannot open file ", FileName
-#   sys.exit()
-
-# On debugging purposes uncomment the next line
-#s = raw_input("Hit any key in this window to exit")
-
 ### Build the header element list
 print fileName, type(fileName)
 header = gdcm.Header(fileName)
 if not header.IsReadable():
-   print "The ", fileName, " file is not readable with gdcm. Sorry."
-   sys.exit()
+   raise RuntimeError,"The '%s' file is not readable with gdcm." % fileName
 
 print "##############################################################"
 print "### Display all the elements and their respective values"