1 from gdcmPython.core import *
5 ### Get filename from command line or default it
9 fileName = os.path.join(GDCM_DATA_PATH, "test.acr")
12 printLevel = int(sys.argv[2])
16 #if not os.path.isfile(FileName):
17 # print "Cannot open file ", FileName
20 # On debugging purposes uncomment the next line
21 #s = raw_input("Hit any key in this window to exit")
23 ### Build the header element list
24 print fileName, type(fileName)
25 header = gdcm.Header(fileName)
26 if not header.IsReadable():
27 print "The ", fileName, " file is not readable with gdcm. Sorry."
30 print "##############################################################"
31 print "### Display all the elements and their respective values"
32 print "## found in the ", fileName, " file."
33 print "##############################################################"
36 val=header.GetNextEntry()
40 val=header.GetNextEntry()