X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=gdcmPython%2Fdemo%2FprintGroupedPublicDict.py;h=153e173b5f97d822a3eed425849f208998f5e469;hb=01f8381d6e75139958807e5b99ba3ebc8e0066c5;hp=1dcd2f79897b1e9b7cdf8cf525cf1420e39a3a23;hpb=b7f909f6f6c37085bb05debd27c375c826c1ce74;p=gdcm.git diff --git a/gdcmPython/demo/printGroupedPublicDict.py b/gdcmPython/demo/printGroupedPublicDict.py index 1dcd2f79..153e173b 100644 --- a/gdcmPython/demo/printGroupedPublicDict.py +++ b/gdcmPython/demo/printGroupedPublicDict.py @@ -1,14 +1,19 @@ from gdcmPython import * -toRead = gdcmHeader(FileName) -toRead.LoadElements() print "##############################################################" print "### Display all the possible tags of the current public" -print "### dictionary, but grouped by using the Fourth field" +print "### dictionary" print "##############################################################" -AllDictFields = toRead.GetPubTagNamesByCategory() -for fourth in AllDictFields.keys(): - print " ############ Fourth group = ", fourth, " ##############" - for entry in AllDictFields[fourth]: - print " ", entry +PubList = gdcmDictSet.GetPubDictTagNames() +for i in range(0, len(PubList)): + print " ", PubList[i] +print "##############################################################" +print "### Display all the possible tags of the current public" +print "### dictionary, but grouped by using the Fourth field" +print "##############################################################" +PubDict = gdcmDictSet.GetPubDictTagNamesByCategory() +for fourth in PubDict: + print " ############ Fourth group = ", fourth, " ##############" + for key in PubDict[fourth]: + print " ", key