1 from gdcmPython import *
3 ### Get filename from command line or default it
7 FileName = os.path.join(GDCM_DATA_PATH, "test.acr")
9 if not os.path.isfile(FileName):
10 print "Cannot open file ", FileName
13 # On debugging purposes uncomment the next line
14 #s = raw_input("Hit any key in this window to exit")
16 ### Build the header element list
17 toRead = gdcmHeader(FileName)
19 print "##############################################################"
20 print "### Display all the elements and their respective values"
21 print "## found in the ", FileName, " file."
22 print "##############################################################"
23 ValDict = toRead.GetPubElVal()
24 for key in ValDict.keys():
25 print "[%s] = [%s]" %(key, ValDict[key])