print ""
print ""
+try:
+ print gdcm.DataEntry
+ print gdcm.DataEntryPtr
+except:
+ pass
+
### Get filename from command line or default it
try:
fileName = sys.argv[1]
printLevel = 1
### Build the file element list
-file = gdcm.File()
+file = gdcm.File.New()
file.SetFileName(fileName)
file.Load()
if not file.IsReadable():
print "##############################################################"
val=file.GetFirstEntry()
while(val):
- if(isinstance(val,gdcm.ValEntryPtr)):
- print "Val %04d|%04d [%s] : %s" % (val.GetGroup(),val.GetElement(),
- val.GetName(),val.GetValue())
- else:
- print "Bin %04d|%04d [%s] : %s" % (val.GetGroup(),val.GetElement(),
- val.GetName(),val.GetValue())
+ if(isinstance(val,gdcm.DataEntry)):
+ print "Data %s [%s] [%s] : %s" % (val.GetKey().str(),val.GetVR().str(),
+ val.GetName(),val.GetString())
val=file.GetNextEntry()
val=None