1 from gdcmPython import *
4 ### Get filename from command line or default it
8 FileName = os.path.join(GDCM_DATA_PATH, "DICOMDIR")
11 printLevel = int(sys.argv[2])
16 ### Build the header element list
17 toRead = gdcmDicomDir(FileName)
26 print "Python progress",toRead.GetProgress()
28 toRead.SetStartMethod(None)
29 toRead.SetProgressMethod(progressMethod)
30 toRead.SetEndMethod(endMethod)
31 toRead.ParseDirectory()
33 print "##############################################################"
34 print "### Display all the elements and their respective values"
35 print "## found in the ", FileName, " file."
36 print "##############################################################"
37 toRead.SetPrintLevel(-1)
40 ValDict = toRead.GetEntry()
41 for key in ValDict.keys():
42 print "[%s] = [%s]" %(key, ValDict[key])