1 from gdcmConfigDemo import *
2 from gdcmPython.core import *
4 print "############################################################## DictSet "
6 dicts=gdcm.Global.GetDicts()
7 if(not isinstance(dicts,gdcm.DictSet)):
8 raise RuntimeError,"The DictSet hasn't the good type (%s)" % type(dicts)
9 print "DictSet content :"
12 print "##################################################### Print Public Dict"
13 # Print the Dict (public)
14 pubDict=dicts.GetDefaultPubDict()
15 if(not isinstance(pubDict,gdcm.Dict)):
16 raise RuntimeError,"The public Dict hasn't the good type (%s)" % type(dict)
17 print "Public Dict content :"
20 print "################################################# DictEntry (0010|0020)"
21 # Print the DictEntry (0010|0020)
24 entry=pubDict.GetEntry(ENTRY_GR,ENTRY_EL)
25 if(not isinstance(entry,gdcm.DictEntry)):
26 raise RuntimeError,"The entry (%04x|%04x) hasn't the good type (%s)" % \
27 (ENTRY_GR,ENTRY_EL,type(entry))
28 print "Entry (%04x|%04x) content :" % (ENTRY_GR,ENTRY_EL)
31 print "########################################### Print Public Dict Entries "
32 # Print the public Dict content
33 print "dict content :"
34 entry=pubDict.GetFirstEntry()
36 print "%4x|%4x [%s] - VM %s : %s (%s)" %\
37 (entry.GetGroup(),entry.GetElement(),entry.GetVR().str(), \
38 entry.GetVM(), entry.GetName(),entry.GetKey().str())
39 entry=pubDict.GetNextEntry()
41 print "########################################################## Game over "