4 sys.path.append('${GDCM_BINARY_DIR}')
6 sys.path.append('${GDCM_BINARY_DIR}/bin')
8 sys.path.append('${GDCM_BINARY_DIR}/bin/Release')
9 sys.path.append('${GDCM_BINARY_DIR}/bin/Debug')
11 from gdcmPython.core import *
13 print "#####################################################################"
15 dicts=gdcm.Global.GetDicts()
16 if(not isinstance(dicts,gdcm.DictSet)):
17 raise RuntimeError,"The DictSet hasn't the good type (%s)" % type(dicts)
18 print "DictSet content :"
21 print "#####################################################################"
22 # Print the Dict (public)
23 pubDict=dicts.GetDefaultPubDict()
24 if(not isinstance(pubDict,gdcm.Dict)):
25 raise RuntimeError,"The public Dict hasn't the good type (%s)" % type(dict)
26 print "Public Dict content :"
29 print "#####################################################################"
30 # Print the DictEntry (0010|0020)
33 entry=pubDict.GetEntry(ENTRY_GR,ENTRY_EL)
34 if(not isinstance(entry,gdcm.DictEntry)):
35 raise RuntimeError,"The entry (%04x|%04x) hasn't the good type (%s)" % \
36 (ENTRY_GR,ENTRY_EL,type(entry))
37 print "Entry (%04x|%04x) content :" % (ENTRY_GR,ENTRY_EL)
40 print "#####################################################################"
41 # Print the public Dict content
42 print "dict content :"
43 entry=pubDict.GetFirstEntry()
45 print "%4x|%4x [%s] - M%s : %s (%s)" %\
46 (entry.GetGroup(),entry.GetElement(),entry.GetVR(),entry.GetVM(),
47 entry.GetName(),entry.GetKey())
48 entry=pubDict.GetNextEntry()