X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=gdcmPython%2Fdemo%2FPrintDicomDir.py;h=a4c534f3422b4da68c0f99f41695fc9b2ca34610;hb=6e9466fd9b712361db37c64dfc5d8a7efaae59f0;hp=b9538392cb903293602da2c321d5842b9776bd14;hpb=4a07b1470f68d316f570fef1f07b9f9c77e90ee1;p=gdcm.git diff --git a/gdcmPython/demo/PrintDicomDir.py b/gdcmPython/demo/PrintDicomDir.py index b9538392..a4c534f3 100644 --- a/gdcmPython/demo/PrintDicomDir.py +++ b/gdcmPython/demo/PrintDicomDir.py @@ -3,9 +3,9 @@ import sys ### Get filename from command line or default it try: - FileName = sys.argv[1] + fileName = sys.argv[1] except IndexError: - FileName = os.path.join(GDCM_DATA_PATH, "DICOMDIR") + fileName = os.path.join(GDCM_DATA_PATH, "DICOMDIR") try: printLevel = int(sys.argv[2]) @@ -13,19 +13,15 @@ except IndexError: printLevel = 1 ### Build the header element list -toRead = gdcmDicomDir(FileName) -if not toRead.IsReadable(): - print "The ", FileName, " DicomDir is not readable with gdcm. Sorry." +dicomdir = gdcmDicomDir(fileName) +if not dicomdir.IsReadable(): + print "The '", fileName, "' DicomDir is not readable with gdcm. Sorry." sys.exit() print "##############################################################" -print "### Display all the elements and their respective values" -print "## found in the ", FileName, " file." +print "## Display all the elements and their respective values" +print "## found in the ", fileName, " file." print "##############################################################" -toRead.SetPrintLevel(-1) -toRead.Print() - -# ValDict = toRead.GetEntry() -# for key in ValDict.keys(): -# print "[%s] = [%s]" %(key, ValDict[key]) +dicomdir.SetPrintLevel(-1) +dicomdir.Print()