1 from gdcmPython import *
4 ### Get filename from command line or default it
8 FileName = os.path.join(GDCM_DATA_PATH, "test.acr")
10 #if not os.path.isfile(FileName):
11 # print "Cannot open file ", FileName
14 # On debugging purposes uncomment the next line
15 #s = raw_input("Hit any key in this window to exit")
17 ### Build the header element list
18 toRead = gdcmHeader(FileName)
19 if not toRead.IsReadable():
20 print "The ", FileName, " file is not readable with gdcm. Sorry."
23 print "##############################################################"
24 print "### Display all the elements and their respective values"
25 print "## found in the ", FileName, " file."
26 print "##############################################################"
27 ValDict = toRead.GetEntry()
28 for key in ValDict.keys():
29 print "[%s] = [%s]" %(key, ValDict[key])